diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/LYBookmark.c | 14 | ||||
-rw-r--r-- | src/LYCgi.c | 6 | ||||
-rw-r--r-- | src/LYCurses.c | 6 | ||||
-rw-r--r-- | src/LYGetFile.c | 13 | ||||
-rw-r--r-- | src/LYJump.c | 4 | ||||
-rw-r--r-- | src/LYMail.c | 10 | ||||
-rw-r--r-- | src/LYMain.c | 20 | ||||
-rw-r--r-- | src/LYNews.c | 4 | ||||
-rw-r--r-- | src/LYOptions.c | 4 | ||||
-rw-r--r-- | src/LYPrint.c | 4 | ||||
-rw-r--r-- | src/LYStrings.c | 6 | ||||
-rw-r--r-- | src/LYUtils.c | 4 | ||||
-rw-r--r-- | src/UCAuto.c | 4 | ||||
-rw-r--r-- | src/chrtrans/makefile.msc | 137 |
14 files changed, 188 insertions, 48 deletions
diff --git a/src/LYBookmark.c b/src/LYBookmark.c index fcaf6fa1..c3116ef6 100644 --- a/src/LYBookmark.c +++ b/src/LYBookmark.c @@ -1,5 +1,5 @@ /* - * $LynxId: LYBookmark.c,v 1.77 2018/03/05 22:32:14 tom Exp $ + * $LynxId: LYBookmark.c,v 1.78 2018/03/18 19:27:30 tom Exp $ */ #include <HTUtils.h> #include <HTAlert.h> @@ -250,7 +250,7 @@ void save_bookmark_link(const char *address, * If BookmarkPage is NULL, something went wrong, so ignore the request. - * FM */ - if (BookmarkPage == NULL) { + if (isEmpty(BookmarkPage)) { FREE(bookmark_URL); return; } @@ -261,9 +261,9 @@ void save_bookmark_link(const char *address, */ if (LYMultiBookmarks != MBM_OFF) { const char *url = HTLoadedDocumentURL(); - const char *page = (*BookmarkPage == '.') - ? (BookmarkPage + 1) - : BookmarkPage; + const char *page = ((*BookmarkPage == '.') + ? (BookmarkPage + 1) + : BookmarkPage); if (strstr(url, page) != NULL) { LYMBM_statusline(MULTIBOOKMARKS_SELF); @@ -898,7 +898,7 @@ int select_menu_multi_bookmarks(void) /* * See if we have a bookmark like that. */ - if (MBM_A_subbookmark[d] != NULL) + if (non_empty(MBM_A_subbookmark[d])) return (d); show_bookmark_not_defined(); @@ -1116,7 +1116,7 @@ static char *title_convert8bit(const char *Title) void set_default_bookmark_page(char *value) { if (value != 0) { - if (bookmark_page == 0 + if (bookmark_page == NULL || strcmp(bookmark_page, value)) { StrAllocCopy(bookmark_page, value); } diff --git a/src/LYCgi.c b/src/LYCgi.c index d6c01372..72493b2c 100644 --- a/src/LYCgi.c +++ b/src/LYCgi.c @@ -1,5 +1,5 @@ /* - * $LynxId: LYCgi.c,v 1.71 2018/03/05 22:36:09 tom Exp $ + * $LynxId: LYCgi.c,v 1.72 2018/03/18 18:56:05 tom Exp $ * Lynx CGI support LYCgi.c * ================ * @@ -639,7 +639,7 @@ static int LYLoadCGI(const char *arg, argv[0] = pgm; /* Begin WebSter Mods -jkt */ - if (LYCgiDocumentRoot != NULL) { + if (non_empty(LYCgiDocumentRoot)) { /* Add DOCUMENT_ROOT to env */ cp = NULL; StrAllocCopy(cp, "DOCUMENT_ROOT="); @@ -653,7 +653,7 @@ static int LYLoadCGI(const char *arg, StrAllocCat(cp, path_info); add_environment_value(cp); } - if (LYCgiDocumentRoot != NULL && path_info != NULL) { + if (non_empty(LYCgiDocumentRoot) && path_info != NULL) { /* Construct and add PATH_TRANSLATED to env */ StrAllocCopy(document_root, LYCgiDocumentRoot); LYTrimHtmlSep(document_root); diff --git a/src/LYCurses.c b/src/LYCurses.c index f3a8dfd2..6656f10b 100644 --- a/src/LYCurses.c +++ b/src/LYCurses.c @@ -1,4 +1,4 @@ -/* $LynxId: LYCurses.c,v 1.192 2018/03/11 22:19:56 tom Exp $ */ +/* $LynxId: LYCurses.c,v 1.193 2018/03/18 19:19:12 tom Exp $ */ #include <HTUtils.h> #include <HTAlert.h> @@ -1809,7 +1809,9 @@ BOOLEAN setup(char *terminal) */ term[0] = '\0'; longname(dummy, term); - if (term[0] == '\0' && (form_get_data || form_post_data)) { + if (term[0] == '\0' && + (non_empty(form_get_data) || + non_empty(form_post_data))) { /* * Some yoyo used these under conditions which require -dump, so force * that mode here. - FM diff --git a/src/LYGetFile.c b/src/LYGetFile.c index 3b06cc92..18e1f788 100644 --- a/src/LYGetFile.c +++ b/src/LYGetFile.c @@ -1,4 +1,4 @@ -/* $LynxId: LYGetFile.c,v 1.94 2016/11/24 15:35:29 tom Exp $ */ +/* $LynxId: LYGetFile.c,v 1.95 2018/03/18 19:34:45 tom Exp $ */ #include <HTUtils.h> #include <HTTP.h> #include <HTAnchor.h> /* Anchor class */ @@ -199,15 +199,16 @@ int getfile(DocInfo *doc, int *target) url_type == LYNXMESSAGES_URL_TYPE || (url_type == LYNXOPTIONS_URL_TYPE && WWWDoc.post_data) || - 0 == STRNADDRCOMP(WWWDoc.address, helpfilepath, - strlen(helpfilepath)) || - (lynxlistfile != NULL && + (non_empty(helpfilepath) && + 0 == STRNADDRCOMP(WWWDoc.address, helpfilepath, + strlen(helpfilepath))) || + (non_empty(lynxlistfile) && 0 == STRNADDRCOMP(WWWDoc.address, lynxlistfile, strlen(lynxlistfile))) || - (lynxlinksfile != NULL && + (non_empty(lynxlinksfile) && 0 == STRNADDRCOMP(WWWDoc.address, lynxlinksfile, strlen(lynxlinksfile))) || - (lynxjumpfile != NULL && + (non_empty(lynxjumpfile) && 0 == STRNADDRCOMP(WWWDoc.address, lynxjumpfile, strlen(lynxjumpfile))))) { HTUserMsg(NOT_HTTP_URL_OR_ACTION); diff --git a/src/LYJump.c b/src/LYJump.c index 0847fd34..877d532d 100644 --- a/src/LYJump.c +++ b/src/LYJump.c @@ -1,5 +1,5 @@ /* - * $LynxId: LYJump.c,v 1.51 2016/11/24 15:35:29 tom Exp $ + * $LynxId: LYJump.c,v 1.52 2018/03/18 19:17:00 tom Exp $ */ #include <HTUtils.h> #include <HTAlert.h> @@ -143,7 +143,7 @@ BOOL LYJumpInit(char *config) if (cp && !JThead) { JThead = jtp; StrAllocCopy(JThead->msg, jumpprompt); - if (!jumpfile) + if (isEmpty(jumpfile)) StrAllocCopy(jumpfile, JThead->file); jtp = typecalloc(struct JumpTable); diff --git a/src/LYMail.c b/src/LYMail.c index 6795aa91..8da6132f 100644 --- a/src/LYMail.c +++ b/src/LYMail.c @@ -1,5 +1,5 @@ /* - * $LynxId: LYMail.c,v 1.98 2018/03/05 22:36:09 tom Exp $ + * $LynxId: LYMail.c,v 1.99 2018/03/18 19:16:29 tom Exp $ */ #include <HTUtils.h> #include <HTParse.h> @@ -1406,7 +1406,7 @@ void reply_by_mail(char *mail_address, label = "From"; #endif /* VMS */ /* Add the personal mail address if there is one. */ - if (personal_mail_address) + if (non_empty(personal_mail_address)) StrAllocCopy(from_address, personal_mail_address); if (!header_prompt(label, &from_address, LINESIZE)) { goto cancelled; @@ -1448,7 +1448,7 @@ void reply_by_mail(char *mail_address, if (!LYNoCc) { LYaddstr(ENTER_ADDRESS_FOR_CC); LYaddstr(BLANK_FOR_NO_COPY); - if (personal_mail_address) + if (non_empty(personal_mail_address)) StrAllocCopy(cc_address, personal_mail_address); if (!header_prompt("Cc", &cc_address, LINESIZE)) { goto cancelled; @@ -1598,7 +1598,7 @@ void reply_by_mail(char *mail_address, LYclear(); /* clear the screen */ goto cleanup; } - if ((body == NULL && LynxSigFile != NULL) && + if ((body == NULL && non_empty(LynxSigFile)) && (fp = fopen(LynxSigFile, TXT_R)) != NULL) { LYStatusLine = (LYlines - 1); if (term_letter) { @@ -1766,7 +1766,7 @@ void reply_by_mail(char *mail_address, */ BOOLEAN LYSystemMail(void) { - if (system_mail == 0 || !strcmp(system_mail, "unknown")) { + if (isEmpty(system_mail) || !strcmp(system_mail, "unknown")) { HTAlert(gettext("No system mailer configured")); return FALSE; } diff --git a/src/LYMain.c b/src/LYMain.c index 92d19574..18c8898f 100644 --- a/src/LYMain.c +++ b/src/LYMain.c @@ -1,5 +1,5 @@ /* - * $LynxId: LYMain.c,v 1.273 2018/03/11 22:49:35 tom Exp $ + * $LynxId: LYMain.c,v 1.274 2018/03/18 19:17:00 tom Exp $ */ #include <HTUtils.h> #include <HTTP.h> @@ -1450,14 +1450,14 @@ int main(int argc, /* * Open command-script, if specified */ - if (lynx_cmd_script != 0) { + if (non_empty(lynx_cmd_script)) { LYTildeExpand(&lynx_cmd_script, TRUE); LYOpenCmdScript(); } /* * Open command-logging, if specified */ - if (lynx_cmd_logfile != 0) { + if (non_empty(lynx_cmd_logfile)) { LYTildeExpand(&lynx_cmd_logfile, TRUE); LYOpenCmdLogfile(argc, argv); } @@ -1483,13 +1483,13 @@ int main(int argc, * If no alternate configuration file was specified on the command line, * see if it's in the environment. */ - if (!lynx_cfg_file) { + if (isEmpty(lynx_cfg_file)) { if (((cp = LYGetEnv("LYNX_CFG")) != NULL) || (cp = LYGetEnv("lynx_cfg")) != NULL) StrAllocCopy(lynx_cfg_file, cp); } #ifdef USE_PROGRAM_DIR - if (!lynx_cfg_file) { + if (isEmpty(lynx_cfg_file)) { HTSprintf0(&lynx_cfg_file, "%s\\lynx.cfg", program_dir); if (!LYCanReadFile(lynx_cfg_file)) { FREE(lynx_cfg_file); @@ -1502,7 +1502,7 @@ int main(int argc, * If we still don't have a configuration file, use the userdefs.h * definition. */ - if (!lynx_cfg_file) + if (isEmpty(lynx_cfg_file)) StrAllocCopy(lynx_cfg_file, LYNX_CFG_FILE); #ifndef _WINDOWS /* avoid the whole ~ thing for now */ @@ -1750,7 +1750,7 @@ int main(int argc, } /* tilde-expand LYCookieSaveFile */ - if (LYCookieSaveFile != NULL) { + if (non_empty(LYCookieSaveFile)) { LYTildeExpand(&LYCookieSaveFile, FALSE); } #ifdef USE_PROGRAM_DIR @@ -1803,10 +1803,10 @@ int main(int argc, /* * We have a save space path, make sure it's valid. - FM */ - if (lynx_save_space && *lynx_save_space == '\0') { + if (isEmpty(lynx_save_space)) { FREE(lynx_save_space); } - if (lynx_save_space) { + if (non_empty(lynx_save_space)) { LYTildeExpand(&lynx_save_space, TRUE); #ifdef VMS LYLowerCase(lynx_save_space); @@ -2074,7 +2074,7 @@ int main(int argc, * force in "//localhost", and if it's not an absolute URL, make it one. - * FM */ - if (homepage) { + if (non_empty(homepage)) { LYEnsureAbsoluteURL(&homepage, "HOMEPAGE", FALSE); } diff --git a/src/LYNews.c b/src/LYNews.c index 81a362eb..bb492890 100644 --- a/src/LYNews.c +++ b/src/LYNews.c @@ -1,5 +1,5 @@ /* - * $LynxId: LYNews.c,v 1.61 2013/11/28 11:21:09 tom Exp $ + * $LynxId: LYNews.c,v 1.62 2018/03/18 18:51:02 tom Exp $ */ #include <HTUtils.h> #ifndef DISABLE_NEWS @@ -407,7 +407,7 @@ char *LYNewsPost(char *newsgroups, || HTConfirmDefault(POST_MSG_PROMPT, NO) != YES) goto cleanup; } - if ((LynxSigFile != NULL) && (fp = fopen(LynxSigFile, TXT_R)) != NULL) { + if ((non_empty(LynxSigFile)) && (fp = fopen(LynxSigFile, TXT_R)) != NULL) { char *msg = NULL; HTSprintf0(&msg, APPEND_SIG_FILE, LynxSigFile); diff --git a/src/LYOptions.c b/src/LYOptions.c index 8b062834..b0084396 100644 --- a/src/LYOptions.c +++ b/src/LYOptions.c @@ -1,4 +1,4 @@ -/* $LynxId: LYOptions.c,v 1.176 2018/03/05 22:18:05 tom Exp $ */ +/* $LynxId: LYOptions.c,v 1.177 2018/03/18 16:38:00 tom Exp $ */ #include <HTUtils.h> #include <HTFTP.h> #include <HTTP.h> /* 'reloading' flag */ @@ -2117,7 +2117,7 @@ typedef struct { const char *HtmlName; } OptValues; -#define END_OPTIONS +#define END_OPTIONS {0, 0, 0} typedef struct { char *tag; diff --git a/src/LYPrint.c b/src/LYPrint.c index 103a4fd6..5cc796a1 100644 --- a/src/LYPrint.c +++ b/src/LYPrint.c @@ -1,5 +1,5 @@ /* - * $LynxId: LYPrint.c,v 1.106 2018/03/05 22:38:53 tom Exp $ + * $LynxId: LYPrint.c,v 1.107 2018/03/18 19:06:06 tom Exp $ */ #include <HTUtils.h> #include <HTAccess.h> @@ -315,7 +315,7 @@ static void send_file_to_file(DocInfo *newdoc, retry: SetupFilename(&filename, sug_filename); - if (lynx_save_space) { + if (non_empty(lynx_save_space)) { BStrCopy0(buffer, lynx_save_space); BStrCat(buffer, filename); BStrCopy(filename, buffer); diff --git a/src/LYStrings.c b/src/LYStrings.c index d89ec19d..676adddc 100644 --- a/src/LYStrings.c +++ b/src/LYStrings.c @@ -1,4 +1,4 @@ -/* $LynxId: LYStrings.c,v 1.270 2018/03/11 23:10:37 tom Exp $ */ +/* $LynxId: LYStrings.c,v 1.271 2018/03/18 19:14:44 tom Exp $ */ #include <HTUtils.h> #include <HTCJK.h> #include <UCAux.h> @@ -6113,7 +6113,7 @@ void LYOpenCmdLogfile(int argc, { int n; - if (lynx_cmd_logfile != 0) { + if (non_empty(lynx_cmd_logfile)) { cmd_logfile = LYNewTxtFile(lynx_cmd_logfile); if (cmd_logfile != 0) { fprintf(cmd_logfile, "# Command logfile created by %s %s (%s)\n", @@ -6132,7 +6132,7 @@ BOOL LYHaveCmdScript(void) void LYOpenCmdScript(void) { - if (lynx_cmd_script != 0) { + if (non_empty(lynx_cmd_script)) { cmd_script = fopen(lynx_cmd_script, TXT_R); CTRACE((tfp, "LYOpenCmdScript(%s) %s\n", lynx_cmd_script, diff --git a/src/LYUtils.c b/src/LYUtils.c index eb462a55..6f196759 100644 --- a/src/LYUtils.c +++ b/src/LYUtils.c @@ -1,5 +1,5 @@ /* - * $LynxId: LYUtils.c,v 1.282 2018/03/11 22:50:21 tom Exp $ + * $LynxId: LYUtils.c,v 1.283 2018/03/18 18:51:53 tom Exp $ */ #include <HTUtils.h> #include <HTTCP.h> @@ -5686,7 +5686,7 @@ char *LYAddPathToSave(char *fname) if (LYisAbsPath(fname)) { StrAllocCopy(result, fname); } else { - if (lynx_save_space != NULL) { + if (non_empty(lynx_save_space)) { StrAllocCopy(result, lynx_save_space); } else { char temp[LY_MAXPATH]; diff --git a/src/UCAuto.c b/src/UCAuto.c index 1d93faab..19e043c0 100644 --- a/src/UCAuto.c +++ b/src/UCAuto.c @@ -1,5 +1,5 @@ /* - * $LynxId: UCAuto.c,v 1.54 2016/11/24 15:35:29 tom Exp $ + * $LynxId: UCAuto.c,v 1.55 2018/03/18 18:51:29 tom Exp $ * * This file contains code for changing the Linux console mode. * Currently some names for font files are hardwired in here. @@ -213,7 +213,7 @@ static int nonempty_file(const char *p) static BOOL on_console(void) { - if ((x_display != NULL) || + if ((non_empty(x_display)) || LYgetXDisplay() != NULL) { /* * We won't do anything in an xterm. Better that way... diff --git a/src/chrtrans/makefile.msc b/src/chrtrans/makefile.msc new file mode 100644 index 00000000..48d074ab --- /dev/null +++ b/src/chrtrans/makefile.msc @@ -0,0 +1,137 @@ +# +# Makefile for Microsoft Visual C++ 4.2 or later +# + +CC = cl +LD = link + +INCLUDES = /I "." /I ".." /I "..\.." /I "..\..\WWW\Library\Implementation" /I "..\..\lib" +DEFS = /D "WIN32_LEAN_AND_MEAN" /D "NDEBUG" /D "__WIN32__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /D "NO_FILEIO_H" /D "NO_UNISTD_H" /D "_WINDOWS" /D "DOSPATH" +CFLAGS = /nologo /MT /W3 /EHsc /O2 /c + +MACHINE = i386 +LDFLAGS = /nologo /subsystem:console /incremental:no /machine:$(MACHINE) +LIBS = user32.lib wsock32.lib + +COMPILE = $(CC) $(CFLAGS) $(INCLUDES) $(DEFS) +LINK = $(LD) $(LDFLAGS) /out:$@ + + +.SUFFIXES: .tbl +# +# This file contains the font map for the default (hardware) font +# + +FONTMAP_INC = iso01_un.h + +TABLES= \ + cp1250_uni.h \ + cp1251_uni.h \ + cp1252_uni.h \ + cp1253_uni.h \ + cp1255_uni.h \ + cp1256_uni.h \ + cp1257_uni.h \ + cp437_uni.h \ + cp737_uni.h \ + cp775_uni.h \ + cp850_uni.h \ + cp852_uni.h \ + cp857_uni.h \ + cp862_uni.h \ + cp864_uni.h \ + cp866_uni.h \ + cp866u_uni.h \ + cp869_uni.h \ + def7_uni.h \ + dmcs_uni.h \ + hp_uni.h \ + iso01_uni.h \ + iso02_uni.h \ + iso03_uni.h \ + iso04_uni.h \ + iso05_uni.h \ + iso06_uni.h \ + iso07_uni.h \ + iso08_uni.h \ + iso09_uni.h \ + iso10_uni.h \ + iso13_uni.h \ + iso14_uni.h \ + iso15_uni.h \ + koi8r_uni.h \ + koi8u_uni.h \ + mac_uni.h \ + mnem2_suni.h \ + mnem_suni.h \ + next_uni.h \ + pt154_uni.h \ + rfc_suni.h \ + utf8_uni.h \ + viscii_uni.h + +default: $(TABLES) + +fontmap: $(FONTMAP_INC) + +makeuctb.exe : makeuctb.obj + $(LINK) makeuctb.obj $(LIBS) + +makeuctb.obj : makeuctb.c + $(COMPILE) makeuctb.c + +.tbl.h: + makeuctb $*.tbl + +cp1250_uni.h: cp1250_uni.tbl makeuctb.exe +cp1251_uni.h: cp1251_uni.tbl makeuctb.exe +cp1252_uni.h: cp1252_uni.tbl makeuctb.exe +cp1253_uni.h: cp1253_uni.tbl makeuctb.exe +cp1255_uni.h: cp1255_uni.tbl makeuctb.exe +cp1256_uni.h: cp1256_uni.tbl makeuctb.exe +cp1257_uni.h: cp1257_uni.tbl makeuctb.exe +cp437_uni.h: cp437_uni.tbl makeuctb.exe +cp737_uni.h: cp737_uni.tbl makeuctb.exe +cp775_uni.h: cp775_uni.tbl makeuctb.exe +cp850_uni.h: cp850_uni.tbl makeuctb.exe +cp852_uni.h: cp852_uni.tbl makeuctb.exe +cp857_uni.h: cp857_uni.tbl makeuctb.exe +cp862_uni.h: cp862_uni.tbl makeuctb.exe +cp864_uni.h: cp864_uni.tbl makeuctb.exe +cp866_uni.h: cp866_uni.tbl makeuctb.exe +cp866u_uni.h: cp866u_uni.tbl makeuctb.exe +cp869_uni.h: cp869_uni.tbl makeuctb.exe +def7_uni.h: def7_uni.tbl makeuctb.exe +dmcs_uni.h: dmcs_uni.tbl makeuctb.exe +hp_uni.h: hp_uni.tbl makeuctb.exe +iso01_uni.h: iso01_uni.tbl makeuctb.exe +iso02_uni.h: iso02_uni.tbl makeuctb.exe +iso03_uni.h: iso03_uni.tbl makeuctb.exe +iso04_uni.h: iso04_uni.tbl makeuctb.exe +iso05_uni.h: iso05_uni.tbl makeuctb.exe +iso06_uni.h: iso06_uni.tbl makeuctb.exe +iso07_uni.h: iso07_uni.tbl makeuctb.exe +iso08_uni.h: iso08_uni.tbl makeuctb.exe +iso09_uni.h: iso09_uni.tbl makeuctb.exe +iso10_uni.h: iso10_uni.tbl makeuctb.exe +iso13_uni.h: iso13_uni.tbl makeuctb.exe +iso14_uni.h: iso14_uni.tbl makeuctb.exe +iso15_uni.h: iso15_uni.tbl makeuctb.exe +koi8r_uni.h: koi8r_uni.tbl makeuctb.exe +koi8u_uni.h: koi8u_uni.tbl makeuctb.exe +mac_uni.h: mac_uni.tbl makeuctb.exe +mnem2_suni.h: mnem2_suni.tbl makeuctb.exe +mnem_suni.h: mnem_suni.tbl makeuctb.exe +next_uni.h: next_uni.tbl makeuctb.exe +pt154_uni.h: pt154_uni.tbl makeuctb.exe +rfc_suni.h: rfc_suni.tbl makeuctb.exe +utf8_uni.h: utf8_uni.tbl makeuctb.exe +viscii_uni.h: viscii_uni.tbl makeuctb.exe + +clean : + - erase *.obj + - erase *.exe + - for %%i in ( $(TABLES) ) do erase %%i + +distclean : clean + - erase *.bak |