diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 1998-05-02 23:39:11 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 1998-05-02 23:39:11 -0400 |
commit | 62e34428d357f609be17a866638bedb45f935d8e (patch) | |
tree | e5921380a563c3d0a2fa7d1cee4524a9f26f3ad9 | |
parent | 2a94396ccd9cf5ade728c53e02cba28e06af4378 (diff) | |
download | lynx-snapshots-62e34428d357f609be17a866638bedb45f935d8e.tar.gz |
snapshot of project "lynx", label v2-8-1dev_8
47 files changed, 2693 insertions, 2701 deletions
diff --git a/CHANGES b/CHANGES index c16b13c3..cdbf06a1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,32 @@ Changes since Lynx 2.8 release ================================================================================ +1998-05-02 (2.8.1dev.8) ++ Fix for CGI-related URLs processing (syntax: ?x=1&yz=2). To avoid interfere + with SGML we restrict '=' as terminator for a named entity, this only applied + for HREF= attribute translation (LYCharUtils.c). (reported by Alex Matulich + alex@unicorn.us.com & FM). - LP ++ restore information in the INSTALLATION file for the DOS port on patching + tcplib. Also, clarifies the location of nullpkt. It also clarifies + that the PDCurses beta has incorporated some of the patches we made for + the lynx DOS port. - DK ++ modify logic that updates bookmark file after removing a link to use copy + rather than rename, to solve file-ownership problems (patch by Paul + Gilmartin, though I kept the permissions check). - TD ++ reduce a little of the clutter in tempname() with fmt_tempname, and + bad_tempname functions. Though this doesn't address the security problems it + does fix the problem with signed getpid values. - TD +* simplify LYUtils.c with compare_type() function - TD +* add/use string functions LYLowerCase, LYUpperCase, LYRemoveBlanks (replaces + collapse_spaces), LYTrimLeading, LYTrimTrailing (incidentally fixes core-dump + in LYCookie.c) - TD +* rewrite read_cfg function to make it more table-driven (reworked from a + patch by John Davis) - TD +* rewrite parse_arg function to make it more table-driven (reworked from a + patch by John Davis) - TD +* omit -Olimit compiler option on Digital UNIX 4.0 (patch by Tomas Vanhala). +* modify configure test for acs_map[] array to work on Digital UNIX 4.0 + (reported by Jim Spath and Tomas Vanhala <vanhala@ling.helsinki.fi>). - TD 1998-04-23 (2.8.1dev.7) * fix core-dump when pressing '.' on a page with no links (patch by Jan Hlav\'{a}\v{c}ek <lahvak@math.ohio-state.edu>). diff --git a/INSTALLATION b/INSTALLATION index 86b39aad..46e6b975 100644 --- a/INSTALLATION +++ b/INSTALLATION @@ -100,12 +100,12 @@ II. Compile instructions -- UNIX NOTE: The 'configure' script generates auxiliary files "config.status" "config.cache" and "config.log". Normally you will not notice these; they are created automatically and removed by a "make distclean". - + + If you wish to rebuild Lynx with a new host, or change ANY of the parameters which are stored in config.cache, you MUST first remove the config.cache file before running configure; its options do NOT override the settings in that file. - + + The config.status file is a script which creates (or regenerates) the files created by the configure script. @@ -219,9 +219,9 @@ II. Compile instructions -- UNIX Use this option to disable "Up-to" parent-links in directory listings. --enable-8bit-toupper (define EXP_8BIT_TOUPPER) - Use experimental 8-bit case-conversion, e.g., for case-insensitive - searches in non-ASCII display character set, this overrides locale - settings. + Use experimental 8-bit case-conversion, e.g., for case-insensitive + searches in non-ASCII display character set, this overrides locale + settings. --enable-color-style (define USE_COLOR_STYLE) Use this option to enable optional and *experimental* color style. @@ -525,10 +525,15 @@ V. Compile instructions -- 386 DOS See "http://www.flora.org/lynx-dev/html/month1097/msg00390.html". You need to compile these before you go any further. If you wish to use the beta version of PDCurses 2.3, you need to first apply a patch (available at - "http://www.flora.org/lynx-dev/html/month0997/msg00441.html"). If you have - trouble applying the patch, we recommend that you use the "patch" program, - ("http://www.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/pat25b.zip"). To - read the Unix man style documentation, use, for example, "less" + "http://www.flora.org/lynx-dev/html/month0997/msg00441.html"). + Most of the patch has already been applied if you get the latest + beta version. If you have trouble applying the patch, we recommend + that you use the "patch" program, + ("http://www.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/pat25b.zip"). + The WATTCP TCPLIB sources also need to be patched prior to compilation. + See "http://www.flora.org/lynx-dev/html/month1197/msg00403.html". + + To read the Unix man style documentation, use, for example, "less" ("http://www.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/lss332b.zip"). Compile or place your compiled PDCurses library in lynx2-*/curses, and compile or place your compiled WATTCP library in lynx2-*/djgpp/tcplib. @@ -543,8 +548,8 @@ V. Compile instructions -- 386 DOS To test Lynx_386 you must have a packet driver installed. The simplest method is to use a null packet driver that just allows Lynx to start up, but doesn't do anything else. One such executable driver has been posted, - uuencoded, to the lynx-dev mailing list: "msg00031.html", "msg00057.html", - and "msg00066.html" under "http://www.flora.org/lynx-dev/html/month0198/". + uuencoded, to the lynx-dev mailing list: + "http://www.flora.org/lynx-dev/html/month0198/msg00057.html". Start the dummy packet driver with "nullpkt 0x60", and take it out of memory with "nullpkt -u". You can also use slip8250.com. See the CRYNWR package "http://www.simtel.net/pub/simtelnet/msdos/pktdrvr/pktd11.zip". diff --git a/LYMessages_en.h b/LYMessages_en.h index 1f9d923a..97640794 100644 --- a/LYMessages_en.h +++ b/LYMessages_en.h @@ -222,6 +222,8 @@ #define BOOKTEMP_OPEN_FAILED_FOR_DEL \ "Unable to open temporary file for deletion of link." #define ERROR_RENAMING_TEMP "Error renaming temporary file." +#define BOOKTEMP_COPY_FAIL \ + "Unable to copy temporary file for deletion of link." #define BOOKTEMP_REOPEN_FAIL_FOR_DEL \ "Unable to reopen temporary file for deletion of link." #endif /* VMS */ diff --git a/WWW/Library/Implementation/HTAAUtil.c b/WWW/Library/Implementation/HTAAUtil.c index 7857ec52..bbcbc508 100644 --- a/WWW/Library/Implementation/HTAAUtil.c +++ b/WWW/Library/Implementation/HTAAUtil.c @@ -1,4 +1,3 @@ - /* MODULE HTAAUtil.c ** COMMON PARTS OF ACCESS AUTHORIZATION MODULE ** FOR BOTH SERVER AND BROWSER @@ -52,6 +51,7 @@ #include <HTTCP.h> #include <HTAlert.h> +#include <LYStrings.h> #include <LYLeaks.h> /* PUBLIC HTAAScheme_enum() @@ -67,17 +67,12 @@ PUBLIC HTAAScheme HTAAScheme_enum ARGS1(CONST char*, name) { char *upcased = NULL; - char *cur; if (!name) return HTAA_UNKNOWN; StrAllocCopy(upcased, name); - cur = upcased; - while (*cur) { - *cur = TOUPPER(*cur); - cur++; - } + LYUpperCase(upcased); if (!strncmp(upcased, "NONE", 4)) { FREE(upcased); @@ -149,23 +144,12 @@ PUBLIC char *HTAAScheme_name ARGS1(HTAAScheme, scheme) */ PUBLIC HTAAMethod HTAAMethod_enum ARGS1(CONST char *, name) { - char tmp[MAX_METHODNAME_LEN+1]; - CONST char *src = name; - char *dest = tmp; - if (!name) return METHOD_UNKNOWN; - while (*src) { - *dest = TOUPPER(*src); - dest++; - src++; - } - *dest = 0; - - if (0==strcmp(tmp, "GET")) + if (0==strcasecomp(name, "GET")) return METHOD_GET; - else if (0==strcmp(tmp, "PUT")) + else if (0==strcasecomp(name, "PUT")) return METHOD_PUT; else return METHOD_UNKNOWN; diff --git a/WWW/Library/Implementation/HTAccess.c b/WWW/Library/Implementation/HTAccess.c index 90d446d9..4eea11b9 100644 --- a/WWW/Library/Implementation/HTAccess.c +++ b/WWW/Library/Implementation/HTAccess.c @@ -968,29 +968,30 @@ PRIVATE BOOL HTLoadDocument ARGS4( return NO; } - if (status <= 0) { /* Failure in accessing a document */ - char *temp = NULL; - StrAllocCopy(temp, "Can't Access `"); - StrAllocCat(temp, full_address); - StrAllocCat(temp, "'"); - _HTProgress(temp); - FREE(temp); - CTRACE(tfp, "HTAccess: Can't access `%s'\n", full_address); - HTLoadError(sink, 500, "Unable to access document."); - return NO; - } - - /* - ** If you get this, then please find which routine is returning - ** a positive unrecognised error code! - */ - fprintf(tfp, + if (status > 0) { + /* + ** If you get this, then please find which routine is returning + ** a positive unrecognised error code! + */ + fprintf(stderr, "**** HTAccess: socket or file number returned by obsolete load routine!\n"); - fprintf(tfp, + fprintf(stderr, "**** HTAccess: Internal software error. Please mail lynx_dev@sig.net!\n"); - fprintf(tfp, "**** HTAccess: Status returned was: %d\n",status); - exit(-1); + fprintf(stderr, "**** HTAccess: Status returned was: %d\n",status); + exit(-1); + } + /* Failure in accessing a document */ + cp = NULL; + StrAllocCopy(cp, "Can't Access `"); + StrAllocCat(cp, full_address); + StrAllocCat(cp, "'"); + _HTProgress(cp); + FREE(cp); + + CTRACE(tfp, "HTAccess: Can't access `%s'\n", full_address); + HTLoadError(sink, 500, "Unable to access document."); + return NO; } /* HTLoadDocument */ /* Load a document from absolute name. HTLoadAbsolute() diff --git a/WWW/Library/Implementation/HTAnchor.c b/WWW/Library/Implementation/HTAnchor.c index 14e258f6..a489eba2 100644 --- a/WWW/Library/Implementation/HTAnchor.c +++ b/WWW/Library/Implementation/HTAnchor.c @@ -44,10 +44,10 @@ PRIVATE int HASH_FUNCTION ARGS1( CONST char *, cp_address) { int hash; - unsigned char *p; + CONST unsigned char *p; - for (p = (unsigned char *)cp_address, hash = 0; *p; p++) - hash = (int) (hash * 3 + (*(unsigned char *)p)) % HASH_SIZE; + for (p = (CONST unsigned char *)cp_address, hash = 0; *p; p++) + hash = (int) (hash * 3 + (*(CONST unsigned char *)p)) % HASH_SIZE; return hash; } diff --git a/WWW/Library/Implementation/HTAuth.c b/WWW/Library/Implementation/HTAuth.c index 573a24b7..70d9781a 100644 --- a/WWW/Library/Implementation/HTAuth.c +++ b/WWW/Library/Implementation/HTAuth.c @@ -146,13 +146,13 @@ PRIVATE HTAAUser *decompose_auth_string ARGS2(char *, authstring, -PRIVATE BOOL HTAA_checkTimeStamp ARGS1(CONST char *, timestamp) +PRIVATE BOOL HTAA_checkTimeStamp ARGS1(CONST char *, timestamp GCC_UNUSED) { return NO; /* This is just a stub */ } -PRIVATE BOOL HTAA_checkInetAddress ARGS1(CONST char *, i_net_adr) +PRIVATE BOOL HTAA_checkInetAddress ARGS1(CONST char *, i_net_adr GCC_UNUSED) { return NO; /* This is just a stub */ } diff --git a/WWW/Library/Implementation/HTCJK.h b/WWW/Library/Implementation/HTCJK.h index c5fa51af..19c8fa66 100644 --- a/WWW/Library/Implementation/HTCJK.h +++ b/WWW/Library/Implementation/HTCJK.h @@ -96,15 +96,15 @@ extern unsigned char * EUC_TO_JIS PARAMS(( CONST char * toA)); extern unsigned char * TO_EUC PARAMS(( - unsigned char * jis, + CONST unsigned char * jis, unsigned char * euc)); extern void TO_SJIS PARAMS(( - unsigned char * any, + CONST unsigned char * any, unsigned char * sjis)); extern void TO_JIS PARAMS(( - unsigned char * any, + CONST unsigned char * any, unsigned char * jis)); #endif /* HTCJK_H */ diff --git a/WWW/Library/Implementation/HTFTP.c b/WWW/Library/Implementation/HTFTP.c index 38ceddd4..0c83e42d 100644 --- a/WWW/Library/Implementation/HTFTP.c +++ b/WWW/Library/Implementation/HTFTP.c @@ -110,6 +110,7 @@ BUGS: @@@ Limit connection cache size! #define IPPORT_FTP 21 #endif /* !IPORT_FTP */ +#include <LYStrings.h> #include <LYLeaks.h> typedef struct _connection { @@ -1417,8 +1418,8 @@ PRIVATE void parse_vms_dir_entry ARGS2( /** Cast VMS non-README file and directory names to lowercase. **/ if (strstr(entry_info->filename, "READ") == NULL) { - for (i = 0; entry_info->filename[i]; i++) - entry_info->filename[i] = TOLOWER(entry_info->filename[i]); + LYLowerCase(entry_info->filename); + i = strlen(entry_info->filename); } else { i = ((strstr(entry_info->filename, "READ") - entry_info->filename) + 4); if (!strncmp((char *)&entry_info->filename[i], "ME", 2)) { @@ -1431,8 +1432,7 @@ PRIVATE void parse_vms_dir_entry ARGS2( } else { i = 0; } - for (; entry_info->filename[i]; i++) - entry_info->filename[i] = TOLOWER(entry_info->filename[i]); + LYLowerCase(entry_info->filename + i); } /** Uppercase terminal .z's or _z's. **/ @@ -1553,28 +1553,22 @@ PRIVATE void parse_ms_windows_dir_entry ARGS2( char *end = line + strlen(line); /** Get rid of blank or junk lines. **/ - while (*cp && isspace(*cp)) - cp++; + cp = LYSkipBlanks(cp); if (!(*cp)) { entry_info->display = FALSE; return; } /** Cut out file or directory name. **/ - cps = cp; - while (*cps && !isspace(*cps)) - cps++; + cps = LYSkipNonBlanks(cp); *cps++ ='\0'; cpd = cps; StrAllocCopy(entry_info->filename, cp); /** Track down the size **/ if (cps < end) { - while (*cps && isspace(*cps)) - cps++; - cpd = cps; - while (*cpd && !isspace(*cpd)) - cpd++; + cps = LYSkipBlanks(cps); + cpd = LYSkipNonBlanks(cps); *cpd++ = '\0'; if (isdigit(*cps)) { entry_info->size = atoi(cps); @@ -1592,8 +1586,7 @@ PRIVATE void parse_ms_windows_dir_entry ARGS2( /** Track down the date. **/ if (cpd < end) { - while (*cpd && isspace(*cpd)) - cpd++; + cpd = LYSkipBlanks(cpd); if (strlen(cpd) > 17) { *(cpd+6) = '\0'; /* Month and Day */ *(cpd+11) = '\0'; /* Year */ @@ -1635,8 +1628,7 @@ PRIVATE void parse_windows_nt_dir_entry ARGS2( int i; /** Get rid of blank or junk lines. **/ - while (*cp && isspace(*cp)) - cp++; + cp = LYSkipBlanks(cp); if (!(*cp)) { entry_info->display = FALSE; return; @@ -1644,9 +1636,7 @@ PRIVATE void parse_windows_nt_dir_entry ARGS2( /** Cut out file or directory name. **/ cpd = cp; - cps = (end-1); - while (cps >= cpd && !isspace(*cps)) - cps--; + cps = LYSkipNonBlanks(end-1); cp = (cps+1); if (!strcmp(cp, ".") || !strcmp(cp, "..")) { entry_info->display = FALSE; @@ -1665,18 +1655,14 @@ PRIVATE void parse_windows_nt_dir_entry ARGS2( /** Cut out the date. **/ cp = cps = cpd; - while (*cps && !isspace(*cps)) - cps++; + cps = LYSkipNonBlanks(cps); *cps++ ='\0'; if (cps > end) { entry_info->display = FALSE; return; } - while (*cps && isspace(*cps)) - cps++; - cpd = cps; - while (*cps && !isspace(*cps)) - cps++; + cps = LYSkipBlanks(cps); + cpd = LYSkipNonBlanks(cps); *cps++ ='\0'; if (cps > end || cpd == cps || strlen(cpd) < 7) { entry_info->display = FALSE; @@ -1717,11 +1703,8 @@ PRIVATE void parse_windows_nt_dir_entry ARGS2( /** Track down the size **/ if (cps < end) { - while (*cps && isspace(*cps)) - cps++; - cpd = cps; - while (*cpd && !isspace(*cpd)) - cpd++; + cps = LYSkipBlanks(cps); + cpd = LYSkipNonBlanks(cps); *cpd = '\0'; if (isdigit(*cps)) { entry_info->size = atoi(cps); @@ -1758,25 +1741,20 @@ PRIVATE void parse_cms_dir_entry ARGS2( int i; /** Get rid of blank or junk lines. **/ - while (*cp && isspace(*cp)) - cp++; + cp = LYSkipBlanks(cp); if (!(*cp)) { entry_info->display = FALSE; return; } /** Cut out file or directory name. **/ - cps = cp; - while (*cps && !isspace(*cps)) - cps++; + cps = LYSkipNonBlanks(cp); *cps++ ='\0'; StrAllocCopy(entry_info->filename, cp); if (strchr(entry_info->filename, '.') != NULL) /** If we already have a dot, we did an NLST. **/ return; - cp = cps; - while (*cp && isspace(*cp)) - cp++; + cp = LYSkipBlanks(cps); if (!(*cp)) { /** If we don't have more, we've misparsed. **/ FREE(entry_info->filename); @@ -1784,9 +1762,7 @@ PRIVATE void parse_cms_dir_entry ARGS2( entry_info->display = FALSE; return; } - cps = cp; - while (*cps && !isspace(*cps)) - cps++; + cps = LYSkipNonBlanks(cp); *cps++ ='\0'; if ((0 == strcasecomp(cp, "DIR")) && (cp - line) > 17) { /** It's an SFS directory. **/ @@ -1801,11 +1777,8 @@ PRIVATE void parse_cms_dir_entry ARGS2( /** Track down the VM/CMS RECFM or type. **/ cp = cps; if (cp < end) { - while (*cp && isspace(*cp)) - cp++; - cps = cp; - while (*cps && !isspace(*cps)) - cps++; + cp = LYSkipBlanks(cp); + cps = LYSkipNonBlanks(cp); *cps++ = '\0'; /** Check cp here, if it's relevant someday. **/ } @@ -1814,11 +1787,8 @@ PRIVATE void parse_cms_dir_entry ARGS2( /** Track down the record length or dash. **/ cp = cps; if (cp < end) { - while (*cp && isspace(*cp)) - cp++; - cps = cp; - while (*cps && !isspace(*cps)) - cps++; + cp = LYSkipBlanks(cp); + cps = LYSkipNonBlanks(cp); *cps++ = '\0'; if (isdigit(*cp)) { RecordLength = atoi(cp); @@ -1828,11 +1798,8 @@ PRIVATE void parse_cms_dir_entry ARGS2( /** Track down the number of records or the dash. **/ cp = cps; if (cps < end) { - while (*cp && isspace(*cp)) - cp++; - cps = cp; - while (*cps && !isspace(*cps)) - cps++; + cp = LYSkipBlanks(cp); + cps = LYSkipNonBlanks(cp); *cps++ = '\0'; if (isdigit(*cp)) { Records = atoi(cp); diff --git a/WWW/Library/Implementation/HTFile.c b/WWW/Library/Implementation/HTFile.c index 0e405b82..c809ff63 100644 --- a/WWW/Library/Implementation/HTFile.c +++ b/WWW/Library/Implementation/HTFile.c @@ -80,6 +80,7 @@ #include <LYexit.h> #include <LYCharSets.h> #include <LYGlobalDefs.h> +#include <LYStrings.h> #include <LYUtils.h> #include <LYLeaks.h> @@ -867,12 +868,10 @@ PUBLIC HTFormat HTCharsetFormat ARGS3( char *cp = NULL, *cp1, *cp2, *cp3 = NULL, *cp4; BOOL chartrans_ok = FALSE; int chndl = -1; - int i; FREE(anchor->charset); StrAllocCopy(cp, format->name); - for (i = 0; cp[i]; i++) - cp[i] = TOLOWER(cp[i]); + LYLowerCase(cp); if (((cp1 = strchr(cp, ';')) != NULL) && (cp2 = strstr(cp1, "charset")) != NULL) { CTRACE(tfp, "HTCharsetFormat: Extended MIME Content-Type is %s\n", diff --git a/WWW/Library/Implementation/HTGopher.c b/WWW/Library/Implementation/HTGopher.c index ddc6a0aa..734b6f2f 100644 --- a/WWW/Library/Implementation/HTGopher.c +++ b/WWW/Library/Implementation/HTGopher.c @@ -74,6 +74,7 @@ */ #include <HTML.h> +#include <LYStrings.h> #include <LYLeaks.h> #define PUTC(c) (*targetClass.put_character)(target, c) @@ -884,7 +885,6 @@ PRIVATE int interpret_cso_key ARGS5( PRIVATE int parse_cso_field_info ARGS1( CSOfield_info *, blk) { - int i; char *info, *max_spec; /* @@ -898,8 +898,7 @@ PRIVATE int parse_cso_field_info ARGS1( ** are converted to all lower-case for comparison. */ info = blk->attributes; - for (i = 0; info[i]; i++) - info[i] = TOLOWER(info[i]); + LYLowerCase(info); if (strstr(info, "indexed ")) blk->indexed = 1; if (strstr(info, "default ")) diff --git a/WWW/Library/Implementation/HTMIME.c b/WWW/Library/Implementation/HTMIME.c index f619eb81..70083ab5 100644 --- a/WWW/Library/Implementation/HTMIME.c +++ b/WWW/Library/Implementation/HTMIME.c @@ -20,6 +20,7 @@ #include <UCAux.h> #include <LYCharSets.h> +#include <LYStrings.h> #include <LYLeaks.h> #define FREE(x) if (x) {free(x); x = NULL;} @@ -331,8 +332,7 @@ PRIVATE void HTMIME_put_character ARGS2( ** we'll make sure they're still gone from any ** charset parameter we check. - FM */ - for (i = 0; cp[i]; i++) - cp[i] = TOLOWER(cp[i]); + LYLowerCase(cp); if ((cp1 = strchr(cp, ';')) != NULL) { BOOL chartrans_ok = NO; if ((cp2 = strstr(cp1, "charset")) != NULL) { @@ -1248,8 +1248,7 @@ PRIVATE void HTMIME_put_character ARGS2( /* ** Convert to lowercase and indicate in anchor. - FM */ - for (i = 0; me->value[i]; i++) - me->value[i] = TOLOWER(me->value[i]); + LYLowerCase(me->value); StrAllocCopy(me->anchor->cache_control, me->value); /* ** Check whether to set no_cache for the anchor. - FM @@ -1373,8 +1372,7 @@ PRIVATE void HTMIME_put_character ARGS2( /* ** Convert to lowercase and indicate in anchor. - FM */ - for (i = 0; me->value[i]; i++) - me->value[i] = TOLOWER(me->value[i]); + LYLowerCase(me->value); StrAllocCopy(me->anchor->content_encoding, me->value); FREE(me->compression_encoding); if (!strcmp(me->value, "8bit") || @@ -1407,8 +1405,7 @@ PRIVATE void HTMIME_put_character ARGS2( /* ** Convert to lowercase and indicate in anchor. - FM */ - for (i = 0; me->value[i]; i++) - me->value[i] = TOLOWER(me->value[i]); + LYLowerCase(me->value); StrAllocCopy(me->anchor->content_language, me->value); break; case miCONTENT_LENGTH: @@ -1463,8 +1460,7 @@ PRIVATE void HTMIME_put_character ARGS2( ** Force the Content-Transfer-Encoding value ** to all lower case. - FM */ - for (i = 0; me->value[i]; i++) - me->value[i] = TOLOWER(me->value[i]); + LYLowerCase(me->value); me->encoding = HTAtom_for(me->value); break; case miCONTENT_TYPE: @@ -2021,8 +2017,7 @@ PUBLIC void HTmmdecode ARGS2( int LYhndl; *qm2 = '\0'; - for (p = s+2; *p; p++) - *p = TOLOWER(*p); + LYLowerCase(s+2); invalid = ((LYhndl = UCGetLYhndl_byMIME(s+2)) < 0 || UCCanTranslateFromTo(LYhndl, current_char_set)); diff --git a/WWW/Library/Implementation/HTTP.c b/WWW/Library/Implementation/HTTP.c index 4cd22539..c2e48411 100644 --- a/WWW/Library/Implementation/HTTP.c +++ b/WWW/Library/Implementation/HTTP.c @@ -33,6 +33,7 @@ #include <HTAABrow.h> #include <LYGlobalDefs.h> +#include <LYStrings.h> #include <LYLeaks.h> struct _HTStream @@ -307,8 +308,7 @@ try_again: strcpy(line, pref_charset); if (line[strlen(line)-1] == ',') line[strlen(line)-1] = '\0'; - for (i = 0; line[i]; i++) - line[i] = TOLOWER(line[i]); + LYLowerCase(line); if (strstr(line, "iso-8859-1") == NULL) strcat(line, ", iso-8859-1;q=0.01"); if (strstr(line, "us-ascii") == NULL) diff --git a/WWW/Library/Implementation/HTVMSUtils.c b/WWW/Library/Implementation/HTVMSUtils.c index 69198b65..21283c9b 100644 --- a/WWW/Library/Implementation/HTVMSUtils.c +++ b/WWW/Library/Implementation/HTVMSUtils.c @@ -1115,11 +1115,7 @@ PUBLIC int HTVMSBrowseDir ARGS4( dot = strstr(entry_info->filename, ".DIR"); if (dot) *dot = '\0'; - cp = entry_info->filename; - while (cp && *cp) { - *cp = TOLOWER(*cp); - cp++; - } + LYLowerCase(entry_info->filename); StrAllocCopy(entry_info->type, "Directory"); } else { if ((cp = strstr(entry_info->filename, "READ")) == NULL) { @@ -1138,10 +1134,7 @@ PUBLIC int HTVMSBrowseDir ARGS4( cp = entry_info->filename; } } - while (cp && *cp) { - *cp = TOLOWER(*cp); - cp++; - } + LYLowerCase(cp); if (((len = strlen(entry_info->filename)) > 2) && entry_info->filename[len-1] == 'z') { if (entry_info->filename[len-2] == '.' || diff --git a/WWW/Library/Implementation/SGML.c b/WWW/Library/Implementation/SGML.c index 21937698..15fc070c 100644 --- a/WWW/Library/Implementation/SGML.c +++ b/WWW/Library/Implementation/SGML.c @@ -3471,10 +3471,11 @@ PUBLIC unsigned char * EUC_TO_JIS ARGS4( } PUBLIC unsigned char * TO_EUC ARGS2( - unsigned char *, jis, + CONST unsigned char *, jis, unsigned char *, euc) { - register unsigned char *s, *d, c, jis_stat; + register CONST unsigned char *s; + register unsigned char *d, c, jis_stat; register int to1B, to2B; register int in_sjis = 0; @@ -3524,7 +3525,7 @@ PUBLIC unsigned char * TO_EUC ARGS2( } PUBLIC void TO_SJIS ARGS2( - unsigned char *, any, + CONST unsigned char *, any, unsigned char *, sjis) { unsigned char *euc; @@ -3542,7 +3543,7 @@ PUBLIC void TO_SJIS ARGS2( } PUBLIC void TO_JIS ARGS2( - unsigned char *, any, + CONST unsigned char *, any, unsigned char *, jis) { unsigned char *euc; diff --git a/aclocal.m4 b/aclocal.m4 index b4c7f6ae..21313bab 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -38,13 +38,18 @@ AC_DEFUN([CF_ALT_CHAR_SET], [ AC_MSG_CHECKING([if curses supports alternate-character set]) AC_CACHE_VAL(cf_cv_alt_char_set,[ +for mapname in acs_map _acs_map +do AC_TRY_LINK([ #include <${cf_cv_ncurses_header-curses.h}> ],[chtype x = acs_map['l']; acs_map['m'] = 0], - [cf_cv_alt_char_set=yes], - [cf_cv_alt_char_set=no])]) + [cf_cv_alt_char_set=$mapname + break], + [cf_cv_alt_char_set=no]) +done + ]) AC_MSG_RESULT($cf_cv_alt_char_set) -test $cf_cv_alt_char_set = yes && AC_DEFINE(ALT_CHAR_SET) +test $cf_cv_alt_char_set != no && AC_DEFINE_UNQUOTED(ALT_CHAR_SET,$mapname) ])dnl dnl --------------------------------------------------------------------------- dnl This is adapted from the macros 'fp_PROG_CC_STDC' and 'fp_C_PROTOTYPES' @@ -62,7 +67,13 @@ cf_save_CFLAGS="$CFLAGS" # HP-UX -Aa -D_HPUX_SOURCE # SVR4 -Xc # UnixWare 1.2 (cannot use -Xc, since ANSI/POSIX clashes) -for cf_arg in "-DCC_HAS_PROTOS" "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" -Xc +for cf_arg in "-DCC_HAS_PROTOS" \ + "" \ + -qlanglvl=ansi \ + -std1 \ + "-Aa -D_HPUX_SOURCE +e" \ + "-Aa -D_HPUX_SOURCE" \ + -Xc do CFLAGS="$cf_save_CFLAGS $cf_arg" AC_TRY_COMPILE( diff --git a/configure b/configure index ab0cabe7..04b48c44 100755 --- a/configure +++ b/configure @@ -2310,11 +2310,17 @@ cf_save_CFLAGS="$CFLAGS" # HP-UX -Aa -D_HPUX_SOURCE # SVR4 -Xc # UnixWare 1.2 (cannot use -Xc, since ANSI/POSIX clashes) -for cf_arg in "-DCC_HAS_PROTOS" "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" -Xc +for cf_arg in "-DCC_HAS_PROTOS" \ + "" \ + -qlanglvl=ansi \ + -std1 \ + "-Aa -D_HPUX_SOURCE +e" \ + "-Aa -D_HPUX_SOURCE" \ + -Xc do CFLAGS="$cf_save_CFLAGS $cf_arg" cat > conftest.$ac_ext <<EOF -#line 2318 "configure" +#line 2324 "configure" #include "confdefs.h" #ifndef CC_HAS_PROTOS @@ -2330,7 +2336,7 @@ int main() { struct s2 {int (*f) (double a);}; ; return 0; } EOF -if { (eval echo configure:2334: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2340: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_ansi_cc="$cf_arg"; break else @@ -2358,12 +2364,12 @@ fi fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2362: checking for working const" >&5 +echo "configure:2368: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2367 "configure" +#line 2373 "configure" #include "confdefs.h" int main() { @@ -2412,7 +2418,7 @@ ccp = (char const *const *) p; ; return 0; } EOF -if { (eval echo configure:2416: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2422: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2453,7 +2459,7 @@ clix*) # contributed by Alex Matulich (matuli_a@marlin.navsea.navy.mil) also # references -lmalloc and -lbsd. echo $ac_n "checking for strcmp in -lc_s""... $ac_c" 1>&6 -echo "configure:2457: checking for strcmp in -lc_s" >&5 +echo "configure:2463: checking for strcmp in -lc_s" >&5 ac_lib_var=`echo c_s'_'strcmp | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2461,7 +2467,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc_s $LIBS" cat > conftest.$ac_ext <<EOF -#line 2465 "configure" +#line 2471 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -2472,7 +2478,7 @@ int main() { strcmp() ; return 0; } EOF -if { (eval echo configure:2476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2535,6 +2541,11 @@ os2*) LDFLAGS=`echo "$LDFLAGS -Zmt -Zcrtdll" | sed "s/-Zexe//g"` PROG_EXT=".exe" ;; +osf4*) + # The -Olimit flag (see below) is no longer available with + # Digital C 5.2, which is bundled with Digital UNIX 4.0. + CFLAGS="$CFLAGS -DDSYS5" + ;; osf*) # Increase the maximum size of functions that will be optimized. test -z "$GCC" && CFLAGS="$CFLAGS -O -Olimit 4000" @@ -2556,7 +2567,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2560: checking for $ac_word" >&5 +echo "configure:2571: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2600,17 +2611,17 @@ sony-newsos*) do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2604: checking for $ac_hdr" >&5 +echo "configure:2615: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2609 "configure" +#line 2620 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2614: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2625: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2654,17 +2665,17 @@ ultrix*) do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2658: checking for $ac_hdr" >&5 +echo "configure:2669: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2663 "configure" +#line 2674 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2668: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2679: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2698,7 +2709,7 @@ esac cf_test_netlibs=no echo $ac_n "checking for network libraries""... $ac_c" 1>&6 -echo "configure:2702: checking for network libraries" >&5 +echo "configure:2713: checking for network libraries" >&5 if eval "test \"`echo '$''{'cf_cv_netlibs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2709,12 +2720,12 @@ cf_test_netlibs=yes for ac_func in gethostname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2713: checking for $ac_func" >&5 +echo "configure:2724: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2718 "configure" +#line 2729 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2737,7 +2748,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2760,7 +2771,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gethostname in -lnsl""... $ac_c" 1>&6 -echo "configure:2764: checking for gethostname in -lnsl" >&5 +echo "configure:2775: checking for gethostname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2768,7 +2779,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $cf_cv_netlibs $LIBS" cat > conftest.$ac_ext <<EOF -#line 2772 "configure" +#line 2783 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -2779,7 +2790,7 @@ int main() { gethostname() ; return 0; } EOF -if { (eval echo configure:2783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2812,7 +2823,7 @@ else echo $ac_n "checking for gethostname in -lsocket""... $ac_c" 1>&6 -echo "configure:2816: checking for gethostname in -lsocket" >&5 +echo "configure:2827: checking for gethostname in -lsocket" >&5 ac_lib_var=`echo socket'_'gethostname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2820,7 +2831,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $cf_cv_netlibs $LIBS" cat > conftest.$ac_ext <<EOF -#line 2824 "configure" +#line 2835 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -2831,7 +2842,7 @@ int main() { gethostname() ; return 0; } EOF -if { (eval echo configure:2835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2875,21 +2886,21 @@ done # FIXME: sequent needs this library (i.e., -lsocket -linet -lnsl), but # I don't know the entrypoints - 97/7/22 TD echo $ac_n "checking for -linet""... $ac_c" 1>&6 -echo "configure:2879: checking for -linet" >&5 +echo "configure:2890: checking for -linet" >&5 if eval "test \"`echo '$''{'ac_cv_lib_inet'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-linet $LIBS" cat > conftest.$ac_ext <<EOF -#line 2886 "configure" +#line 2897 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:2893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_lib_inet=yes else @@ -2912,12 +2923,12 @@ if test "$ac_cv_func_lsocket" != no ; then for ac_func in socket do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2916: checking for $ac_func" >&5 +echo "configure:2927: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2921 "configure" +#line 2932 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2940,7 +2951,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2963,7 +2974,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 -echo "configure:2967: checking for socket in -lsocket" >&5 +echo "configure:2978: checking for socket in -lsocket" >&5 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2971,7 +2982,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $cf_cv_netlibs $LIBS" cat > conftest.$ac_ext <<EOF -#line 2975 "configure" +#line 2986 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -2982,7 +2993,7 @@ int main() { socket() ; return 0; } EOF -if { (eval echo configure:2986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3015,7 +3026,7 @@ else echo $ac_n "checking for socket in -lbsd""... $ac_c" 1>&6 -echo "configure:3019: checking for socket in -lbsd" >&5 +echo "configure:3030: checking for socket in -lbsd" >&5 ac_lib_var=`echo bsd'_'socket | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3023,7 +3034,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lbsd $cf_cv_netlibs $LIBS" cat > conftest.$ac_ext <<EOF -#line 3027 "configure" +#line 3038 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3034,7 +3045,7 @@ int main() { socket() ; return 0; } EOF -if { (eval echo configure:3038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3079,12 +3090,12 @@ fi for ac_func in gethostbyname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3083: checking for $ac_func" >&5 +echo "configure:3094: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3088 "configure" +#line 3099 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3107,7 +3118,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3130,7 +3141,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:3134: checking for gethostbyname in -lnsl" >&5 +echo "configure:3145: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3138,7 +3149,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $cf_cv_netlibs $LIBS" cat > conftest.$ac_ext <<EOF -#line 3142 "configure" +#line 3153 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3149,7 +3160,7 @@ int main() { gethostbyname() ; return 0; } EOF -if { (eval echo configure:3153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3190,12 +3201,12 @@ done for ac_func in strcasecmp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3194: checking for $ac_func" >&5 +echo "configure:3205: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3199 "configure" +#line 3210 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3218,7 +3229,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3241,7 +3252,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for strcasecmp in -lresolv""... $ac_c" 1>&6 -echo "configure:3245: checking for strcasecmp in -lresolv" >&5 +echo "configure:3256: checking for strcasecmp in -lresolv" >&5 ac_lib_var=`echo resolv'_'strcasecmp | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3249,7 +3260,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lresolv $cf_cv_netlibs $LIBS" cat > conftest.$ac_ext <<EOF -#line 3253 "configure" +#line 3264 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3260,7 +3271,7 @@ int main() { strcasecmp() ; return 0; } EOF -if { (eval echo configure:3264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3305,7 +3316,7 @@ test $cf_test_netlibs = no && echo "$cf_cv_netlibs" >&6 echo $ac_n "checking for screen type""... $ac_c" 1>&6 -echo "configure:3309: checking for screen type" >&5 +echo "configure:3320: checking for screen type" >&5 if eval "test \"`echo '$''{'cf_cv_screen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3340,12 +3351,12 @@ case $cf_cv_screen in curses) echo $ac_n "checking for initscr""... $ac_c" 1>&6 -echo "configure:3344: checking for initscr" >&5 +echo "configure:3355: checking for initscr" >&5 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3349 "configure" +#line 3360 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char initscr(); below. */ @@ -3368,7 +3379,7 @@ initscr(); ; return 0; } EOF -if { (eval echo configure:3372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_initscr=yes" else @@ -3389,7 +3400,7 @@ else case $host_os in #(vi freebsd*) #(vi echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6 -echo "configure:3393: checking for tgoto in -lmytinfo" >&5 +echo "configure:3404: checking for tgoto in -lmytinfo" >&5 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3397,7 +3408,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lmytinfo $LIBS" cat > conftest.$ac_ext <<EOF -#line 3401 "configure" +#line 3412 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3408,7 +3419,7 @@ int main() { tgoto() ; return 0; } EOF -if { (eval echo configure:3412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3431,7 +3442,7 @@ fi ;; hpux10.*) echo $ac_n "checking for initscr in -lcur_colr""... $ac_c" 1>&6 -echo "configure:3435: checking for initscr in -lcur_colr" >&5 +echo "configure:3446: checking for initscr in -lcur_colr" >&5 ac_lib_var=`echo cur_colr'_'initscr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3439,7 +3450,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcur_colr $LIBS" cat > conftest.$ac_ext <<EOF -#line 3443 "configure" +#line 3454 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3450,7 +3461,7 @@ int main() { initscr() ; return 0; } EOF -if { (eval echo configure:3454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3474,7 +3485,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for initscr in -lHcurses""... $ac_c" 1>&6 -echo "configure:3478: checking for initscr in -lHcurses" >&5 +echo "configure:3489: checking for initscr in -lHcurses" >&5 ac_lib_var=`echo Hcurses'_'initscr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3482,7 +3493,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lHcurses $LIBS" cat > conftest.$ac_ext <<EOF -#line 3486 "configure" +#line 3497 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3493,7 +3504,7 @@ int main() { initscr() ; return 0; } EOF -if { (eval echo configure:3497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3539,12 +3550,12 @@ if test ".$ac_cv_func_initscr" != .yes ; then # Check for library containing tgoto. Do this before curses library # because it may be needed to link the test-case for initscr. echo $ac_n "checking for tgoto""... $ac_c" 1>&6 -echo "configure:3543: checking for tgoto" >&5 +echo "configure:3554: checking for tgoto" >&5 if eval "test \"`echo '$''{'ac_cv_func_tgoto'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3548 "configure" +#line 3559 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char tgoto(); below. */ @@ -3567,7 +3578,7 @@ tgoto(); ; return 0; } EOF -if { (eval echo configure:3571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_tgoto=yes" else @@ -3588,7 +3599,7 @@ else for cf_term_lib in termcap termlib unknown do echo $ac_n "checking for tgoto in -l$cf_term_lib""... $ac_c" 1>&6 -echo "configure:3592: checking for tgoto in -l$cf_term_lib" >&5 +echo "configure:3603: checking for tgoto in -l$cf_term_lib" >&5 ac_lib_var=`echo $cf_term_lib'_'tgoto | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3596,7 +3607,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$cf_term_lib $LIBS" cat > conftest.$ac_ext <<EOF -#line 3600 "configure" +#line 3611 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3607,7 +3618,7 @@ int main() { tgoto() ; return 0; } EOF -if { (eval echo configure:3611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3637,7 +3648,7 @@ fi for cf_curs_lib in cursesX curses ncurses xcurses jcurses unknown do echo $ac_n "checking for initscr in -l$cf_curs_lib""... $ac_c" 1>&6 -echo "configure:3641: checking for initscr in -l$cf_curs_lib" >&5 +echo "configure:3652: checking for initscr in -l$cf_curs_lib" >&5 ac_lib_var=`echo $cf_curs_lib'_'initscr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3645,7 +3656,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$cf_curs_lib $LIBS" cat > conftest.$ac_ext <<EOF -#line 3649 "configure" +#line 3660 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3656,7 +3667,7 @@ int main() { initscr() ; return 0; } EOF -if { (eval echo configure:3660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3682,16 +3693,16 @@ fi LIBS="-l$cf_curs_lib $cf_save_LIBS" if test "$cf_term_lib" = unknown ; then echo $ac_n "checking if we can link with $cf_curs_lib library""... $ac_c" 1>&6 -echo "configure:3686: checking if we can link with $cf_curs_lib library" >&5 +echo "configure:3697: checking if we can link with $cf_curs_lib library" >&5 cat > conftest.$ac_ext <<EOF -#line 3688 "configure" +#line 3699 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header-curses.h}> int main() { initscr() ; return 0; } EOF -if { (eval echo configure:3695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cf_result=yes else @@ -3705,16 +3716,16 @@ rm -f conftest* test $cf_result = no && { echo "configure: error: Cannot link curses library" 1>&2; exit 1; } elif test "$cf_term_lib" != predefined ; then echo $ac_n "checking if we need both $cf_curs_lib and $cf_term_lib libraries""... $ac_c" 1>&6 -echo "configure:3709: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5 +echo "configure:3720: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5 cat > conftest.$ac_ext <<EOF -#line 3711 "configure" +#line 3722 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header-curses.h}> int main() { initscr(); tgoto((char *)0, 0, 0); ; return 0; } EOF -if { (eval echo configure:3718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cf_result=no else @@ -3724,14 +3735,14 @@ else LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS" cat > conftest.$ac_ext <<EOF -#line 3728 "configure" +#line 3739 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header-curses.h}> int main() { initscr() ; return 0; } EOF -if { (eval echo configure:3735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cf_result=yes else @@ -3753,14 +3764,14 @@ fi echo $ac_n "checking for curses performance tradeoff""... $ac_c" 1>&6 -echo "configure:3757: checking for curses performance tradeoff" >&5 +echo "configure:3768: checking for curses performance tradeoff" >&5 if eval "test \"`echo '$''{'cf_cv_curs_performance'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cf_cv_curs_performance=no cat > conftest.$ac_ext <<EOF -#line 3764 "configure" +#line 3775 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header-curses.h}> @@ -3774,11 +3785,11 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3778: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3789: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat > conftest.$ac_ext <<EOF -#line 3782 "configure" +#line 3793 "configure" #include "confdefs.h" #define CURS_PERFORMANCE @@ -3793,7 +3804,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3797: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3808: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_curs_performance=yes else @@ -3818,13 +3829,13 @@ EOF ncurses) echo $ac_n "checking for ncurses header file""... $ac_c" 1>&6 -echo "configure:3822: checking for ncurses header file" >&5 +echo "configure:3833: checking for ncurses header file" >&5 if eval "test \"`echo '$''{'cf_cv_ncurses_header'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3828 "configure" +#line 3839 "configure" #include "confdefs.h" #include <curses.h> int main() { @@ -3841,7 +3852,7 @@ make an error ; return 0; } EOF -if { (eval echo configure:3845: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3856: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_ncurses_header=predefined else @@ -3927,7 +3938,7 @@ done ;; esac echo $ac_n "checking for ncurses version""... $ac_c" 1>&6 -echo "configure:3931: checking for ncurses version" >&5 +echo "configure:3942: checking for ncurses version" >&5 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3952,7 +3963,7 @@ Autoconf "old" #endif EOF cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out" - { (eval echo configure:3956: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; } + { (eval echo configure:3967: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; } if test -f conftest.out ; then cf_out=`cat conftest.out | sed -e 's@^Autoconf @@' -e 's@^[^"]*"@@' -e 's@".*@@'` test -n "$cf_out" && cf_cv_ncurses_version="$cf_out" @@ -3961,7 +3972,7 @@ EOF else cat > conftest.$ac_ext <<EOF -#line 3965 "configure" +#line 3976 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header-curses.h}> @@ -3984,7 +3995,7 @@ int main() exit(0); } EOF -if { (eval echo configure:3988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then cf_cv_ncurses_version=`cat $cf_tempfile` @@ -4009,7 +4020,7 @@ echo "$ac_t""$cf_cv_ncurses_version" 1>&6 cf_ncurses_LIBS="" cf_ncurses_SAVE="$LIBS" echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6 -echo "configure:4013: checking for Gpm_Open in -lgpm" >&5 +echo "configure:4024: checking for Gpm_Open in -lgpm" >&5 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4017,7 +4028,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgpm $LIBS" cat > conftest.$ac_ext <<EOF -#line 4021 "configure" +#line 4032 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4028,7 +4039,7 @@ int main() { Gpm_Open() ; return 0; } EOF -if { (eval echo configure:4032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4044,7 +4055,7 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for initscr in -lgpm""... $ac_c" 1>&6 -echo "configure:4048: checking for initscr in -lgpm" >&5 +echo "configure:4059: checking for initscr in -lgpm" >&5 ac_lib_var=`echo gpm'_'initscr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4052,7 +4063,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgpm $LIBS" cat > conftest.$ac_ext <<EOF -#line 4056 "configure" +#line 4067 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4063,7 +4074,7 @@ int main() { initscr() ; return 0; } EOF -if { (eval echo configure:4067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4094,7 +4105,7 @@ freebsd*) # This is only necessary if you are linking against an obsolete # version of ncurses (but it should do no harm, since it's static). echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6 -echo "configure:4098: checking for tgoto in -lmytinfo" >&5 +echo "configure:4109: checking for tgoto in -lmytinfo" >&5 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4102,7 +4113,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lmytinfo $LIBS" cat > conftest.$ac_ext <<EOF -#line 4106 "configure" +#line 4117 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4113,7 +4124,7 @@ int main() { tgoto() ; return 0; } EOF -if { (eval echo configure:4117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4141,12 +4152,12 @@ LIBS="$cf_ncurses_LIBS $LIBS" cf_cv_have_lib_ncurses=no cf_libdir="" echo $ac_n "checking for initscr""... $ac_c" 1>&6 -echo "configure:4145: checking for initscr" >&5 +echo "configure:4156: checking for initscr" >&5 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4150 "configure" +#line 4161 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char initscr(); below. */ @@ -4169,7 +4180,7 @@ initscr(); ; return 0; } EOF -if { (eval echo configure:4173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_initscr=yes" else @@ -4189,17 +4200,17 @@ else cf_save_LIBS="$LIBS" echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6 -echo "configure:4193: checking for initscr in -lncurses" >&5 +echo "configure:4204: checking for initscr in -lncurses" >&5 LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <<EOF -#line 4196 "configure" +#line 4207 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header-curses.h}> int main() { initscr() ; return 0; } EOF -if { (eval echo configure:4203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6 cf_cv_have_lib_ncurses=yes @@ -4226,17 +4237,17 @@ test "$prefix" != /usr && cf_search="$cf_search /usr/lib /usr/lib/ncur for cf_libdir in $cf_search do echo $ac_n "checking for -lncurses in $cf_libdir""... $ac_c" 1>&6 -echo "configure:4230: checking for -lncurses in $cf_libdir" >&5 +echo "configure:4241: checking for -lncurses in $cf_libdir" >&5 LIBS="-L$cf_libdir -lncurses $cf_save_LIBS" cat > conftest.$ac_ext <<EOF -#line 4233 "configure" +#line 4244 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header-curses.h}> int main() { initscr() ; return 0; } EOF -if { (eval echo configure:4240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6 cf_cv_have_lib_ncurses=yes @@ -4268,7 +4279,7 @@ esac if test -n "$cf_ncurses_LIBS" ; then echo $ac_n "checking if we can link ncurses without $cf_ncurses_LIBS""... $ac_c" 1>&6 -echo "configure:4272: checking if we can link ncurses without $cf_ncurses_LIBS" >&5 +echo "configure:4283: checking if we can link ncurses without $cf_ncurses_LIBS" >&5 cf_ncurses_SAVE="$LIBS" for p in $cf_ncurses_LIBS ; do q=`echo $LIBS | sed -e 's/'$p' //' -e 's/'$p'$//'` @@ -4277,14 +4288,14 @@ echo "configure:4272: checking if we can link ncurses without $cf_ncurses_LIBS" fi done cat > conftest.$ac_ext <<EOF -#line 4281 "configure" +#line 4292 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header-curses.h}> int main() { initscr(); mousemask(0,0); tgoto((char *)0, 0, 0); ; return 0; } EOF -if { (eval echo configure:4288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -4301,20 +4312,20 @@ fi slang) echo $ac_n "checking for slang header file""... $ac_c" 1>&6 -echo "configure:4305: checking for slang header file" >&5 +echo "configure:4316: checking for slang header file" >&5 if eval "test \"`echo '$''{'cf_cv_slang_header'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4311 "configure" +#line 4322 "configure" #include "confdefs.h" #include <slang.h> int main() { printf("%s\n", SLANG_VERSION) ; return 0; } EOF -if { (eval echo configure:4318: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4329: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_slang_header=predefined else @@ -4398,7 +4409,7 @@ cf_cv_lib_termcap=none # HP-UX 9.x terminfo has setupterm, but no tigetstr. if test "$termlib" = none; then echo $ac_n "checking for tigetstr in -ltermlib""... $ac_c" 1>&6 -echo "configure:4402: checking for tigetstr in -ltermlib" >&5 +echo "configure:4413: checking for tigetstr in -ltermlib" >&5 ac_lib_var=`echo termlib'_'tigetstr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4406,7 +4417,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ltermlib $LIBS" cat > conftest.$ac_ext <<EOF -#line 4410 "configure" +#line 4421 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4417,7 +4428,7 @@ int main() { tigetstr() ; return 0; } EOF -if { (eval echo configure:4421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4440,7 +4451,7 @@ fi fi if test "$cf_cv_lib_termcap" = none; then echo $ac_n "checking for tgoto in -ltermlib""... $ac_c" 1>&6 -echo "configure:4444: checking for tgoto in -ltermlib" >&5 +echo "configure:4455: checking for tgoto in -ltermlib" >&5 ac_lib_var=`echo termlib'_'tgoto | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4448,7 +4459,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ltermlib $LIBS" cat > conftest.$ac_ext <<EOF -#line 4452 "configure" +#line 4463 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4459,7 +4470,7 @@ int main() { tgoto() ; return 0; } EOF -if { (eval echo configure:4463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4483,7 +4494,7 @@ fi if test "$cf_cv_lib_termcap" = none; then # allow curses library for broken AIX system. echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>&6 -echo "configure:4487: checking for initscr in -lcurses" >&5 +echo "configure:4498: checking for initscr in -lcurses" >&5 ac_lib_var=`echo curses'_'initscr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4491,7 +4502,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcurses $LIBS" cat > conftest.$ac_ext <<EOF -#line 4495 "configure" +#line 4506 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4502,7 +4513,7 @@ int main() { initscr() ; return 0; } EOF -if { (eval echo configure:4506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4523,7 +4534,7 @@ else fi echo $ac_n "checking for tgoto in -ltermcap""... $ac_c" 1>&6 -echo "configure:4527: checking for tgoto in -ltermcap" >&5 +echo "configure:4538: checking for tgoto in -ltermcap" >&5 ac_lib_var=`echo termcap'_'tgoto | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4531,7 +4542,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ltermcap $LIBS" cat > conftest.$ac_ext <<EOF -#line 4535 "configure" +#line 4546 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4542,7 +4553,7 @@ int main() { tgoto() ; return 0; } EOF -if { (eval echo configure:4546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4565,7 +4576,7 @@ fi fi if test "$cf_cv_lib_termcap" = none; then echo $ac_n "checking for tgoto in -ltermcap""... $ac_c" 1>&6 -echo "configure:4569: checking for tgoto in -ltermcap" >&5 +echo "configure:4580: checking for tgoto in -ltermcap" >&5 ac_lib_var=`echo termcap'_'tgoto | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4573,7 +4584,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ltermcap $LIBS" cat > conftest.$ac_ext <<EOF -#line 4577 "configure" +#line 4588 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4584,7 +4595,7 @@ int main() { tgoto() ; return 0; } EOF -if { (eval echo configure:4588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4607,7 +4618,7 @@ fi fi if test "$cf_cv_lib_termcap" = none; then echo $ac_n "checking for tgoto in -lncurses""... $ac_c" 1>&6 -echo "configure:4611: checking for tgoto in -lncurses" >&5 +echo "configure:4622: checking for tgoto in -lncurses" >&5 ac_lib_var=`echo ncurses'_'tgoto | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4615,7 +4626,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <<EOF -#line 4619 "configure" +#line 4630 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4626,7 +4637,7 @@ int main() { tgoto() ; return 0; } EOF -if { (eval echo configure:4630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4656,12 +4667,12 @@ fi cf_slang_LIBS2="$LIBS" echo $ac_n "checking for acos""... $ac_c" 1>&6 -echo "configure:4660: checking for acos" >&5 +echo "configure:4671: checking for acos" >&5 if eval "test \"`echo '$''{'ac_cv_func_acos'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4665 "configure" +#line 4676 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char acos(); below. */ @@ -4684,7 +4695,7 @@ acos(); ; return 0; } EOF -if { (eval echo configure:4688: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_acos=yes" else @@ -4703,7 +4714,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for acos in -lm""... $ac_c" 1>&6 -echo "configure:4707: checking for acos in -lm" >&5 +echo "configure:4718: checking for acos in -lm" >&5 ac_lib_var=`echo m'_'acos | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4711,7 +4722,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS $LIBS" cat > conftest.$ac_ext <<EOF -#line 4715 "configure" +#line 4726 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4722,7 +4733,7 @@ int main() { acos() ; return 0; } EOF -if { (eval echo configure:4726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4762,12 +4773,12 @@ fi cf_cv_have_lib_slang=no cf_libdir="" echo $ac_n "checking for SLtt_get_screen_size""... $ac_c" 1>&6 -echo "configure:4766: checking for SLtt_get_screen_size" >&5 +echo "configure:4777: checking for SLtt_get_screen_size" >&5 if eval "test \"`echo '$''{'ac_cv_func_SLtt_get_screen_size'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4771 "configure" +#line 4782 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char SLtt_get_screen_size(); below. */ @@ -4790,7 +4801,7 @@ SLtt_get_screen_size(); ; return 0; } EOF -if { (eval echo configure:4794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_SLtt_get_screen_size=yes" else @@ -4810,17 +4821,17 @@ else cf_save_LIBS="$LIBS" echo $ac_n "checking for SLtt_get_screen_size in -lslang""... $ac_c" 1>&6 -echo "configure:4814: checking for SLtt_get_screen_size in -lslang" >&5 +echo "configure:4825: checking for SLtt_get_screen_size in -lslang" >&5 LIBS="-lslang $LIBS" cat > conftest.$ac_ext <<EOF -#line 4817 "configure" +#line 4828 "configure" #include "confdefs.h" #include <slang.h> int main() { SLtt_get_screen_size() ; return 0; } EOF -if { (eval echo configure:4824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6 cf_cv_have_lib_slang=yes @@ -4847,17 +4858,17 @@ test "$prefix" != /usr && cf_search="$cf_search /usr/lib /usr/lib/slan for cf_libdir in $cf_search do echo $ac_n "checking for -lslang in $cf_libdir""... $ac_c" 1>&6 -echo "configure:4851: checking for -lslang in $cf_libdir" >&5 +echo "configure:4862: checking for -lslang in $cf_libdir" >&5 LIBS="-L$cf_libdir -lslang $cf_save_LIBS" cat > conftest.$ac_ext <<EOF -#line 4854 "configure" +#line 4865 "configure" #include "confdefs.h" #include <slang.h> int main() { SLtt_get_screen_size() ; return 0; } EOF -if { (eval echo configure:4861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6 cf_cv_have_lib_slang=yes @@ -4888,7 +4899,7 @@ esac cf_slang_LIBS3="$LIBS" echo $ac_n "checking if we can link slang without termcap""... $ac_c" 1>&6 -echo "configure:4892: checking if we can link slang without termcap" >&5 +echo "configure:4903: checking if we can link slang without termcap" >&5 if test -n "`echo $cf_slang_LIBS1 | sed -e 's/ //g'`" ; then cf_exclude=`echo ".$cf_slang_LIBS2" | sed -e "s@$cf_slang_LIBS1@@" -e 's@^.@@'` else @@ -4896,14 +4907,14 @@ else fi LIBS=`echo ".$cf_slang_LIBS3" | sed -e "s@$cf_exclude@@" -e 's@^.@@'` cat > conftest.$ac_ext <<EOF -#line 4900 "configure" +#line 4911 "configure" #include "confdefs.h" #include <slang.h> int main() { SLtt_get_screen_size() ; return 0; } EOF -if { (eval echo configure:4907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cf_result=yes else @@ -4923,7 +4934,7 @@ eval cf_libdir=$libdir cf_libdir=`echo $cf_libdir | sed -e s@'^NONE/'@$prefix/@ -e s@'^NONE/'@$ac_default_prefix/@` echo $ac_n "checking for location of config-file""... $ac_c" 1>&6 -echo "configure:4927: checking for location of config-file" >&5 +echo "configure:4938: checking for location of config-file" >&5 LYNX_CFG_FILE=$cf_libdir/lynx.cfg cat >> confdefs.h <<EOF #define LYNX_CFG_FILE "$LYNX_CFG_FILE" @@ -4933,12 +4944,12 @@ echo "$ac_t""$LYNX_CFG_FILE" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:4937: checking for ANSI C header files" >&5 +echo "configure:4948: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4942 "configure" +#line 4953 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -4946,7 +4957,7 @@ else #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4950: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4961: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -4963,7 +4974,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 4967 "configure" +#line 4978 "configure" #include "confdefs.h" #include <string.h> EOF @@ -4981,7 +4992,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 4985 "configure" +#line 4996 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -5002,7 +5013,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <<EOF -#line 5006 "configure" +#line 5017 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -5013,7 +5024,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:5017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else @@ -5037,12 +5048,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:5041: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:5052: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5046 "configure" +#line 5057 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/time.h> @@ -5051,7 +5062,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:5055: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5066: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -5076,12 +5087,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:5080: checking for $ac_hdr that defines DIR" >&5 +echo "configure:5091: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5085 "configure" +#line 5096 "configure" #include "confdefs.h" #include <sys/types.h> #include <$ac_hdr> @@ -5089,7 +5100,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:5093: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5104: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -5114,7 +5125,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:5118: checking for opendir in -ldir" >&5 +echo "configure:5129: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5122,7 +5133,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <<EOF -#line 5126 "configure" +#line 5137 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5133,7 +5144,7 @@ int main() { opendir() ; return 0; } EOF -if { (eval echo configure:5137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5155,7 +5166,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:5159: checking for opendir in -lx" >&5 +echo "configure:5170: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5163,7 +5174,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <<EOF -#line 5167 "configure" +#line 5178 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5174,7 +5185,7 @@ int main() { opendir() ; return 0; } EOF -if { (eval echo configure:5178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5213,17 +5224,17 @@ for ac_hdr in \ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5217: checking for $ac_hdr" >&5 +echo "configure:5228: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5222 "configure" +#line 5233 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5227: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5238: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5251,13 +5262,13 @@ done echo $ac_n "checking termio.h and termios.h""... $ac_c" 1>&6 -echo "configure:5255: checking termio.h and termios.h" >&5 +echo "configure:5266: checking termio.h and termios.h" >&5 if eval "test \"`echo '$''{'cf_cv_termio_and_termios'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5261 "configure" +#line 5272 "configure" #include "confdefs.h" #if HAVE_TERMIO_H @@ -5270,7 +5281,7 @@ int main() { putchar (0x0a) ; return 0; } EOF -if { (eval echo configure:5274: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5285: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_termio_and_termios=yes else @@ -5293,17 +5304,17 @@ for ac_hdr in sys/wait.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5297: checking for $ac_hdr" >&5 +echo "configure:5308: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5302 "configure" +#line 5313 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5307: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5318: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5340,17 +5351,17 @@ for ac_hdr in wait.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5344: checking for $ac_hdr" >&5 +echo "configure:5355: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5349 "configure" +#line 5360 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5354: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5365: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5380,17 +5391,17 @@ for ac_hdr in waitstatus.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5384: checking for $ac_hdr" >&5 +echo "configure:5395: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5389 "configure" +#line 5400 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5394: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5405: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5431,13 +5442,13 @@ fi echo $ac_n "checking for union wait""... $ac_c" 1>&6 -echo "configure:5435: checking for union wait" >&5 +echo "configure:5446: checking for union wait" >&5 if eval "test \"`echo '$''{'cf_cv_type_unionwait'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5441 "configure" +#line 5452 "configure" #include "confdefs.h" $cf_wait_headers int main() { @@ -5448,7 +5459,7 @@ int x; ; return 0; } EOF -if { (eval echo configure:5452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cf_cv_type_unionwait=no echo compiles ok w/o union wait 1>&5 @@ -5459,7 +5470,7 @@ else rm -rf conftest* cat > conftest.$ac_ext <<EOF -#line 5463 "configure" +#line 5474 "configure" #include "confdefs.h" $cf_wait_headers int main() { @@ -5474,7 +5485,7 @@ union wait x; ; return 0; } EOF -if { (eval echo configure:5478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cf_cv_type_unionwait=yes echo compiles ok with union wait and possibly macros too 1>&5 @@ -5501,20 +5512,20 @@ EOF if test $cf_cv_type_unionwait = yes; then echo $ac_n "checking if union wait can be used as wait-arg""... $ac_c" 1>&6 -echo "configure:5505: checking if union wait can be used as wait-arg" >&5 +echo "configure:5516: checking if union wait can be used as wait-arg" >&5 if eval "test \"`echo '$''{'cf_cv_arg_union_wait'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5511 "configure" +#line 5522 "configure" #include "confdefs.h" $cf_wait_headers int main() { union wait x; wait(&x) ; return 0; } EOF -if { (eval echo configure:5518: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5529: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_arg_union_wait=yes else @@ -5534,20 +5545,20 @@ EOF echo $ac_n "checking if union wait can be used as waitpid-arg""... $ac_c" 1>&6 -echo "configure:5538: checking if union wait can be used as waitpid-arg" >&5 +echo "configure:5549: checking if union wait can be used as waitpid-arg" >&5 if eval "test \"`echo '$''{'cf_cv_arg_union_waitpid'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5544 "configure" +#line 5555 "configure" #include "confdefs.h" $cf_wait_headers int main() { union wait x; waitpid(0, &x, 0) ; return 0; } EOF -if { (eval echo configure:5551: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5562: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_arg_union_waitpid=yes else @@ -5569,12 +5580,12 @@ EOF fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:5573: checking for mode_t" >&5 +echo "configure:5584: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5578 "configure" +#line 5589 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -5604,12 +5615,12 @@ fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:5608: checking for pid_t" >&5 +echo "configure:5619: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5613 "configure" +#line 5624 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -5638,17 +5649,17 @@ fi ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:5642: checking for vfork.h" >&5 +echo "configure:5653: checking for vfork.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5647 "configure" +#line 5658 "configure" #include "confdefs.h" #include <vfork.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5652: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5663: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5673,18 +5684,18 @@ else fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:5677: checking for working vfork" >&5 +echo "configure:5688: checking for working vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then echo $ac_n "checking for vfork""... $ac_c" 1>&6 -echo "configure:5683: checking for vfork" >&5 +echo "configure:5694: checking for vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5688 "configure" +#line 5699 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char vfork(); below. */ @@ -5707,7 +5718,7 @@ vfork(); ; return 0; } EOF -if { (eval echo configure:5711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_vfork=yes" else @@ -5728,7 +5739,7 @@ fi else cat > conftest.$ac_ext <<EOF -#line 5732 "configure" +#line 5743 "configure" #include "confdefs.h" /* Thanks to Paul Eggert for this test. */ #include <stdio.h> @@ -5823,7 +5834,7 @@ main() { } } EOF -if { (eval echo configure:5827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_vfork_works=yes else @@ -5847,13 +5858,13 @@ fi echo $ac_n "checking if we should use fcntl or ioctl""... $ac_c" 1>&6 -echo "configure:5851: checking if we should use fcntl or ioctl" >&5 +echo "configure:5862: checking if we should use fcntl or ioctl" >&5 if eval "test \"`echo '$''{'cf_cv_fionbio'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5857 "configure" +#line 5868 "configure" #include "confdefs.h" #include <sys/types.h> @@ -5865,7 +5876,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cf_cv_fionbio=ioctl else @@ -5874,7 +5885,7 @@ else rm -rf conftest* cat > conftest.$ac_ext <<EOF -#line 5878 "configure" +#line 5889 "configure" #include "confdefs.h" #include <sys/types.h> @@ -5891,7 +5902,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cf_cv_fionbio=fcntl else @@ -5914,20 +5925,20 @@ EOF echo $ac_n "checking for broken/missing definition of remove""... $ac_c" 1>&6 -echo "configure:5918: checking for broken/missing definition of remove" >&5 +echo "configure:5929: checking for broken/missing definition of remove" >&5 if eval "test \"`echo '$''{'cf_cv_baddef_remove'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5924 "configure" +#line 5935 "configure" #include "confdefs.h" #include <stdio.h> int main() { remove("dummy") ; return 0; } EOF -if { (eval echo configure:5931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cf_cv_baddef_remove=no else @@ -5935,7 +5946,7 @@ else cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext <<EOF -#line 5939 "configure" +#line 5950 "configure" #include "confdefs.h" #include <stdio.h> int __unlink(name) { return unlink(name); } @@ -5943,7 +5954,7 @@ int main() { remove("dummy") ; return 0; } EOF -if { (eval echo configure:5947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cf_cv_baddef_remove=yes else @@ -5967,13 +5978,13 @@ EOF echo $ac_n "checking for lstat""... $ac_c" 1>&6 -echo "configure:5971: checking for lstat" >&5 +echo "configure:5982: checking for lstat" >&5 if eval "test \"`echo '$''{'ac_cv_func_lstat'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5977 "configure" +#line 5988 "configure" #include "confdefs.h" #include <sys/types.h> @@ -5982,7 +5993,7 @@ int main() { lstat(".", (struct stat *)0) ; return 0; } EOF -if { (eval echo configure:5986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_func_lstat=yes else @@ -6014,12 +6025,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6018: checking for $ac_func" >&5 +echo "configure:6029: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6023 "configure" +#line 6034 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6042,7 +6053,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:6046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6072,12 +6083,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6076: checking for $ac_func" >&5 +echo "configure:6087: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6081 "configure" +#line 6092 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6100,7 +6111,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:6104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6131,12 +6142,12 @@ for ac_func in strstr do echo $ac_n "checking for $ac_func declaration""... $ac_c" 1>&6 -echo "configure:6135: checking for $ac_func declaration" >&5 +echo "configure:6146: checking for $ac_func declaration" >&5 if eval "test \"`echo '$''{'ac_cv_func_decl_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6140 "configure" +#line 6151 "configure" #include "confdefs.h" #include <string.h> int main() { @@ -6145,11 +6156,11 @@ extern int ${ac_func}(); #endif ; return 0; } EOF -if { (eval echo configure:6149: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6160: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat > conftest.$ac_ext <<EOF -#line 6153 "configure" +#line 6164 "configure" #include "confdefs.h" #include <string.h> int main() { @@ -6158,7 +6169,7 @@ int (*p)() = ${ac_func}; #endif ; return 0; } EOF -if { (eval echo configure:6162: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_decl_$ac_func=yes" @@ -6200,12 +6211,12 @@ for ac_func in getgrgid getgrnam do echo $ac_n "checking for $ac_func declaration""... $ac_c" 1>&6 -echo "configure:6204: checking for $ac_func declaration" >&5 +echo "configure:6215: checking for $ac_func declaration" >&5 if eval "test \"`echo '$''{'ac_cv_func_decl_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6209 "configure" +#line 6220 "configure" #include "confdefs.h" #include <stdio.h> @@ -6216,11 +6227,11 @@ extern int ${ac_func}(); #endif ; return 0; } EOF -if { (eval echo configure:6220: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6231: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat > conftest.$ac_ext <<EOF -#line 6224 "configure" +#line 6235 "configure" #include "confdefs.h" #include <stdio.h> @@ -6231,7 +6242,7 @@ int (*p)() = ${ac_func}; #endif ; return 0; } EOF -if { (eval echo configure:6235: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6246: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_decl_$ac_func=yes" @@ -6273,13 +6284,13 @@ done echo $ac_n "checking if TRUE/FALSE are defined""... $ac_c" 1>&6 -echo "configure:6277: checking if TRUE/FALSE are defined" >&5 +echo "configure:6288: checking if TRUE/FALSE are defined" >&5 if eval "test \"`echo '$''{'cf_cv_bool_defs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6283 "configure" +#line 6294 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header-curses.h}> @@ -6288,7 +6299,7 @@ int main() { int x = TRUE, y = FALSE ; return 0; } EOF -if { (eval echo configure:6292: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6303: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_bool_defs=yes else @@ -6315,13 +6326,13 @@ fi echo $ac_n "checking declaration of errno""... $ac_c" 1>&6 -echo "configure:6319: checking declaration of errno" >&5 +echo "configure:6330: checking declaration of errno" >&5 if eval "test \"`echo '$''{'cf_cv_dcl_errno'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6325 "configure" +#line 6336 "configure" #include "confdefs.h" #if HAVE_STDLIB_H @@ -6334,7 +6345,7 @@ int main() { long x = (long) errno ; return 0; } EOF -if { (eval echo configure:6338: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval 'cf_cv_dcl_'errno'=yes' else @@ -6364,9 +6375,9 @@ cf_result=`echo $cf_result | tr '[a-z]' '[A-Z]'` EOF echo $ac_n "checking existence of errno""... $ac_c" 1>&6 -echo "configure:6368: checking existence of errno" >&5 +echo "configure:6379: checking existence of errno" >&5 cat > conftest.$ac_ext <<EOF -#line 6370 "configure" +#line 6381 "configure" #include "confdefs.h" #undef errno @@ -6376,7 +6387,7 @@ int main() { errno = 2 ; return 0; } EOF -if { (eval echo configure:6380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval 'cf_cv_have_'errno'=yes' else @@ -6406,20 +6417,20 @@ EOF echo $ac_n "checking for setlocale()""... $ac_c" 1>&6 -echo "configure:6410: checking for setlocale()" >&5 +echo "configure:6421: checking for setlocale()" >&5 if eval "test \"`echo '$''{'cf_cv_locale'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6416 "configure" +#line 6427 "configure" #include "confdefs.h" #include <locale.h> int main() { setlocale(LC_ALL, "") ; return 0; } EOF -if { (eval echo configure:6423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cf_cv_locale=yes else @@ -6440,13 +6451,13 @@ EOF echo $ac_n "checking if NGROUPS is defined""... $ac_c" 1>&6 -echo "configure:6444: checking if NGROUPS is defined" >&5 +echo "configure:6455: checking if NGROUPS is defined" >&5 if eval "test \"`echo '$''{'cf_cv_ngroups'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6450 "configure" +#line 6461 "configure" #include "confdefs.h" #if HAVE_SYS_PARAM_H @@ -6460,7 +6471,7 @@ int main() { int x = NGROUPS ; return 0; } EOF -if { (eval echo configure:6464: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6475: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_ngroups=yes else @@ -6468,7 +6479,7 @@ else cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext <<EOF -#line 6472 "configure" +#line 6483 "configure" #include "confdefs.h" #if HAVE_SYS_PARAM_H @@ -6482,7 +6493,7 @@ int main() { int x = NGROUPS_MAX ; return 0; } EOF -if { (eval echo configure:6486: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6497: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_ngroups=NGROUPS_MAX else @@ -6516,13 +6527,13 @@ for cf_name in sys_nerr sys_errlist do echo $ac_n "checking declaration of $cf_name""... $ac_c" 1>&6 -echo "configure:6520: checking declaration of $cf_name" >&5 +echo "configure:6531: checking declaration of $cf_name" >&5 if eval "test \"`echo '$''{'cf_cv_dcl_$cf_name'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6526 "configure" +#line 6537 "configure" #include "confdefs.h" #if HAVE_STDLIB_H @@ -6535,7 +6546,7 @@ int main() { long x = (long) $cf_name ; return 0; } EOF -if { (eval echo configure:6539: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6550: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval 'cf_cv_dcl_'$cf_name'=yes' else @@ -6565,9 +6576,9 @@ cf_result=`echo $cf_result | tr '[a-z]' '[A-Z]'` EOF echo $ac_n "checking existence of $cf_name""... $ac_c" 1>&6 -echo "configure:6569: checking existence of $cf_name" >&5 +echo "configure:6580: checking existence of $cf_name" >&5 cat > conftest.$ac_ext <<EOF -#line 6571 "configure" +#line 6582 "configure" #include "confdefs.h" #undef $cf_name @@ -6577,7 +6588,7 @@ int main() { $cf_name = 2 ; return 0; } EOF -if { (eval echo configure:6581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval 'cf_cv_have_'$cf_name'=yes' else @@ -6608,13 +6619,13 @@ done echo $ac_n "checking if struct utmp is declared""... $ac_c" 1>&6 -echo "configure:6612: checking if struct utmp is declared" >&5 +echo "configure:6623: checking if struct utmp is declared" >&5 if eval "test \"`echo '$''{'cf_cv_have_utmp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6618 "configure" +#line 6629 "configure" #include "confdefs.h" #include <sys/types.h> @@ -6623,7 +6634,7 @@ int main() { struct utmp x; char *y = &x.ut_host[0] ; return 0; } EOF -if { (eval echo configure:6627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6638: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_have_utmp=yes else @@ -6631,14 +6642,14 @@ else cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext <<EOF -#line 6635 "configure" +#line 6646 "configure" #include "confdefs.h" #include <utmpx.h> int main() { struct utmpx x; char *y = &x.ut_host[0] ; return 0; } EOF -if { (eval echo configure:6642: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_have_utmp=utmpx else @@ -6669,13 +6680,15 @@ EOF if test $cf_cv_screen != slang ; then echo $ac_n "checking if curses supports alternate-character set""... $ac_c" 1>&6 -echo "configure:6673: checking if curses supports alternate-character set" >&5 +echo "configure:6684: checking if curses supports alternate-character set" >&5 if eval "test \"`echo '$''{'cf_cv_alt_char_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else +for mapname in acs_map _acs_map +do cat > conftest.$ac_ext <<EOF -#line 6679 "configure" +#line 6692 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header-curses.h}> @@ -6684,9 +6697,10 @@ int main() { chtype x = acs_map['l']; acs_map['m'] = 0 ; return 0; } EOF -if { (eval echo configure:6688: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* - cf_cv_alt_char_set=yes + cf_cv_alt_char_set=$mapname + break else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 @@ -6694,23 +6708,25 @@ else cf_cv_alt_char_set=no fi rm -f conftest* +done + fi echo "$ac_t""$cf_cv_alt_char_set" 1>&6 -test $cf_cv_alt_char_set = yes && cat >> confdefs.h <<\EOF -#define ALT_CHAR_SET 1 +test $cf_cv_alt_char_set != no && cat >> confdefs.h <<EOF +#define ALT_CHAR_SET $mapname EOF echo $ac_n "checking if curses supports fancy attributes""... $ac_c" 1>&6 -echo "configure:6708: checking if curses supports fancy attributes" >&5 +echo "configure:6724: checking if curses supports fancy attributes" >&5 if eval "test \"`echo '$''{'cf_cv_fancy_curses'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6714 "configure" +#line 6730 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header-curses.h}> @@ -6723,7 +6739,7 @@ attrset(A_UNDERLINE|A_BOLD|A_REVERSE); ; return 0; } EOF -if { (eval echo configure:6727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cf_cv_fancy_curses=yes else @@ -6743,7 +6759,7 @@ EOF echo $ac_n "checking for ncurses version""... $ac_c" 1>&6 -echo "configure:6747: checking for ncurses version" >&5 +echo "configure:6763: checking for ncurses version" >&5 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6768,7 +6784,7 @@ Autoconf "old" #endif EOF cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out" - { (eval echo configure:6772: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; } + { (eval echo configure:6788: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; } if test -f conftest.out ; then cf_out=`cat conftest.out | sed -e 's@^Autoconf @@' -e 's@^[^"]*"@@' -e 's@".*@@'` test -n "$cf_out" && cf_cv_ncurses_version="$cf_out" @@ -6777,7 +6793,7 @@ EOF else cat > conftest.$ac_ext <<EOF -#line 6781 "configure" +#line 6797 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header-curses.h}> @@ -6800,7 +6816,7 @@ int main() exit(0); } EOF -if { (eval echo configure:6804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then cf_cv_ncurses_version=`cat $cf_tempfile` @@ -6820,13 +6836,13 @@ echo "$ac_t""$cf_cv_ncurses_version" 1>&6 if test "$cf_cv_ncurses_version" != no ; then echo $ac_n "checking for obsolete/broken version of ncurses""... $ac_c" 1>&6 -echo "configure:6824: checking for obsolete/broken version of ncurses" >&5 +echo "configure:6840: checking for obsolete/broken version of ncurses" >&5 if eval "test \"`echo '$''{'cf_cv_ncurses_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6830 "configure" +#line 6846 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header-curses.h}> @@ -6840,7 +6856,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:6844: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6860: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_ncurses_broken=no else @@ -6865,13 +6881,13 @@ fi echo $ac_n "checking if curses supports color attributes""... $ac_c" 1>&6 -echo "configure:6869: checking if curses supports color attributes" >&5 +echo "configure:6885: checking if curses supports color attributes" >&5 if eval "test \"`echo '$''{'cf_cv_color_curses'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6875 "configure" +#line 6891 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header-curses.h}> @@ -6886,7 +6902,7 @@ chtype x = COLOR_BLUE; ; return 0; } EOF -if { (eval echo configure:6890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cf_cv_color_curses=yes else @@ -6913,7 +6929,7 @@ fi echo $ac_n "checking declaration of size-change""... $ac_c" 1>&6 -echo "configure:6917: checking declaration of size-change" >&5 +echo "configure:6933: checking declaration of size-change" >&5 if eval "test \"`echo '$''{'cf_cv_sizechange'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6927,7 +6943,7 @@ do CFLAGS="$cf_save_CFLAGS" test -n "$cf_opts" && CFLAGS="$CFLAGS -D$cf_opts" cat > conftest.$ac_ext <<EOF -#line 6931 "configure" +#line 6947 "configure" #include "confdefs.h" #include <sys/types.h> #if HAVE_TERMIOS_H @@ -6966,7 +6982,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:6970: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6986: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_sizechange=yes else @@ -6998,20 +7014,20 @@ EOF echo $ac_n "checking if ttytype is declared in curses library""... $ac_c" 1>&6 -echo "configure:7002: checking if ttytype is declared in curses library" >&5 +echo "configure:7018: checking if ttytype is declared in curses library" >&5 if eval "test \"`echo '$''{'cf_cv_have_ttytype'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7008 "configure" +#line 7024 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header-curses.h}> int main() { char *x = &ttytype[1]; *x = 1 ; return 0; } EOF -if { (eval echo configure:7015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cf_cv_have_ttytype=yes else @@ -7038,12 +7054,12 @@ EOF do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7042: checking for $ac_func" >&5 +echo "configure:7058: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7047 "configure" +#line 7063 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -7066,7 +7082,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:7070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7096,7 +7112,7 @@ fi echo $ac_n "checking if experimental 8-bit case-conversion should be used""... $ac_c" 1>&6 -echo "configure:7100: checking if experimental 8-bit case-conversion should be used" >&5 +echo "configure:7116: checking if experimental 8-bit case-conversion should be used" >&5 # Check whether --enable-8bit-toupper or --disable-8bit-toupper was given. if test "${enable_8bit_toupper+set}" = set; then @@ -7120,7 +7136,7 @@ EOF echo $ac_n "checking if color-style code should be used""... $ac_c" 1>&6 -echo "configure:7124: checking if color-style code should be used" >&5 +echo "configure:7140: checking if color-style code should be used" >&5 # Check whether --enable-color-style or --disable-color-style was given. if test "${enable_color_style+set}" = set; then @@ -7168,7 +7184,7 @@ EOF echo "$ac_t""yes" 1>&6 echo $ac_n "checking for location of style-sheet file""... $ac_c" 1>&6 -echo "configure:7172: checking for location of style-sheet file" >&5 +echo "configure:7188: checking for location of style-sheet file" >&5 LYNX_LSS_FILE=$cf_libdir/lynx.lss cat >> confdefs.h <<EOF #define LYNX_LSS_FILE "$LYNX_LSS_FILE" @@ -7186,7 +7202,7 @@ test ".$ac_cv_func_use_default_colors" = ".yes" && use_dft_colors=maybe if test "$use_dft_colors" != no ; then echo $ac_n "checking if you want to use default-colors""... $ac_c" 1>&6 -echo "configure:7190: checking if you want to use default-colors" >&5 +echo "configure:7206: checking if you want to use default-colors" >&5 # Check whether --enable-default-colors or --disable-default-colors was given. if test "${enable_default_colors+set}" = set; then @@ -7211,7 +7227,7 @@ EOF fi echo $ac_n "checking if you want to use extended HTML DTD logic""... $ac_c" 1>&6 -echo "configure:7215: checking if you want to use extended HTML DTD logic" >&5 +echo "configure:7231: checking if you want to use extended HTML DTD logic" >&5 # Check whether --enable-extended-dtd or --disable-extended-dtd was given. if test "${enable_extended_dtd+set}" = set; then @@ -7235,7 +7251,7 @@ EOF echo $ac_n "checking if you want to use external commands""... $ac_c" 1>&6 -echo "configure:7239: checking if you want to use external commands" >&5 +echo "configure:7255: checking if you want to use external commands" >&5 # Check whether --enable-externs or --disable-externs was given. if test "${enable_externs+set}" = set; then @@ -7259,7 +7275,7 @@ EOF echo $ac_n "checking if you want to use setfont support""... $ac_c" 1>&6 -echo "configure:7263: checking if you want to use setfont support" >&5 +echo "configure:7279: checking if you want to use setfont support" >&5 # Check whether --enable-font-switch or --disable-font-switch was given. if test "${enable_font_switch+set}" = set; then @@ -7283,7 +7299,7 @@ EOF echo $ac_n "checking if you want internal-links feature""... $ac_c" 1>&6 -echo "configure:7287: checking if you want internal-links feature" >&5 +echo "configure:7303: checking if you want internal-links feature" >&5 # Check whether --enable-internal-links or --disable-internal-links was given. if test "${enable_internal_links+set}" = set; then @@ -7307,7 +7323,7 @@ EOF echo $ac_n "checking if you want to fork NSL requests""... $ac_c" 1>&6 -echo "configure:7311: checking if you want to fork NSL requests" >&5 +echo "configure:7327: checking if you want to fork NSL requests" >&5 # Check whether --enable-nsl-fork or --disable-nsl-fork was given. if test "${enable_nsl_fork+set}" = set; then @@ -7331,7 +7347,7 @@ EOF echo $ac_n "checking if you want to underline links""... $ac_c" 1>&6 -echo "configure:7335: checking if you want to underline links" >&5 +echo "configure:7351: checking if you want to underline links" >&5 # Check whether --enable-underlines or --disable-underlines was given. if test "${enable_underlines+set}" = set; then @@ -7355,7 +7371,7 @@ EOF echo $ac_n "checking if you want to use zlib for decompression of some gzip files""... $ac_c" 1>&6 -echo "configure:7359: checking if you want to use zlib for decompression of some gzip files" >&5 +echo "configure:7375: checking if you want to use zlib for decompression of some gzip files" >&5 # Check whether --with-zlib or --without-zlib was given. if test "${with_zlib+set}" = set; then @@ -7372,12 +7388,12 @@ if test ".$use_zlib" != ".no" ; then cf_cv_have_lib_z=no cf_libdir="" echo $ac_n "checking for gzopen""... $ac_c" 1>&6 -echo "configure:7376: checking for gzopen" >&5 +echo "configure:7392: checking for gzopen" >&5 if eval "test \"`echo '$''{'ac_cv_func_gzopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7381 "configure" +#line 7397 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gzopen(); below. */ @@ -7400,7 +7416,7 @@ gzopen(); ; return 0; } EOF -if { (eval echo configure:7404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_gzopen=yes" else @@ -7420,17 +7436,17 @@ else cf_save_LIBS="$LIBS" echo $ac_n "checking for gzopen in -lz""... $ac_c" 1>&6 -echo "configure:7424: checking for gzopen in -lz" >&5 +echo "configure:7440: checking for gzopen in -lz" >&5 LIBS="-lz $LIBS" cat > conftest.$ac_ext <<EOF -#line 7427 "configure" +#line 7443 "configure" #include "confdefs.h" #include <zlib.h> int main() { gzopen("name","mode") ; return 0; } EOF -if { (eval echo configure:7434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6 cf_cv_have_lib_z=yes @@ -7457,17 +7473,17 @@ test "$prefix" != /usr && cf_search="$cf_search /usr/lib /usr/lib/z" for cf_libdir in $cf_search do echo $ac_n "checking for -lz in $cf_libdir""... $ac_c" 1>&6 -echo "configure:7461: checking for -lz in $cf_libdir" >&5 +echo "configure:7477: checking for -lz in $cf_libdir" >&5 LIBS="-L$cf_libdir -lz $cf_save_LIBS" cat > conftest.$ac_ext <<EOF -#line 7464 "configure" +#line 7480 "configure" #include "confdefs.h" #include <zlib.h> int main() { gzopen("name","mode") ; return 0; } EOF -if { (eval echo configure:7471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6 cf_cv_have_lib_z=yes @@ -7508,7 +7524,7 @@ fi # All DirEd functions that were enabled on compilation can be disabled # or modified at run time via DIRED_MENU symbols in lynx.cfg. echo $ac_n "checking if directory-editor code should be used""... $ac_c" 1>&6 -echo "configure:7512: checking if directory-editor code should be used" >&5 +echo "configure:7528: checking if directory-editor code should be used" >&5 # Check whether --enable-dired or --disable-dired was given. if test "${enable_dired+set}" = set; then @@ -7534,7 +7550,7 @@ EOF echo $ac_n "checking if you wish to allow extracting from archives via DirEd""... $ac_c" 1>&6 -echo "configure:7538: checking if you wish to allow extracting from archives via DirEd" >&5 +echo "configure:7554: checking if you wish to allow extracting from archives via DirEd" >&5 # Check whether --enable-dired-archive or --disable-dired-archive was given. if test "${enable_dired_archive+set}" = set; then @@ -7553,7 +7569,7 @@ fi echo "$ac_t""$enableval" 1>&6 echo $ac_n "checking if you wish to allow users to redefine DirEd keys""... $ac_c" 1>&6 -echo "configure:7557: checking if you wish to allow users to redefine DirEd keys" >&5 +echo "configure:7573: checking if you wish to allow users to redefine DirEd keys" >&5 # Check whether --enable-dired-override or --disable-dired-override was given. if test "${enable_dired_override+set}" = set; then @@ -7579,7 +7595,7 @@ fi echo "$ac_t""$enableval" 1>&6 echo $ac_n "checking if you wish to allow permissions commands via DirEd""... $ac_c" 1>&6 -echo "configure:7583: checking if you wish to allow permissions commands via DirEd" >&5 +echo "configure:7599: checking if you wish to allow permissions commands via DirEd" >&5 # Check whether --enable-dired-permit or --disable-dired-permit was given. if test "${enable_dired_permit+set}" = set; then @@ -7605,7 +7621,7 @@ fi echo "$ac_t""$enableval" 1>&6 echo $ac_n "checking if you wish to allow executable-permission commands via DirEd""... $ac_c" 1>&6 -echo "configure:7609: checking if you wish to allow executable-permission commands via DirEd" >&5 +echo "configure:7625: checking if you wish to allow executable-permission commands via DirEd" >&5 # Check whether --enable-dired-xpermit or --disable-dired-xpermit was given. if test "${enable_dired_xpermit+set}" = set; then @@ -7624,7 +7640,7 @@ fi echo "$ac_t""$enableval" 1>&6 echo $ac_n "checking if you wish to allow "tar" commands from DirEd""... $ac_c" 1>&6 -echo "configure:7628: checking if you wish to allow "tar" commands from DirEd" >&5 +echo "configure:7644: checking if you wish to allow "tar" commands from DirEd" >&5 # Check whether --enable-dired-tar or --disable-dired-tar was given. if test "${enable_dired_tar+set}" = set; then @@ -7650,7 +7666,7 @@ fi echo "$ac_t""$enableval" 1>&6 echo $ac_n "checking if you wish to allow "uudecode" commands from DirEd""... $ac_c" 1>&6 -echo "configure:7654: checking if you wish to allow "uudecode" commands from DirEd" >&5 +echo "configure:7670: checking if you wish to allow "uudecode" commands from DirEd" >&5 # Check whether --enable-dired-uudecode or --disable-dired-uudecode was given. if test "${enable_dired_uudecode+set}" = set; then @@ -7676,7 +7692,7 @@ fi echo "$ac_t""$enableval" 1>&6 echo $ac_n "checking if you wish to allow "zip" and "unzip" commands from DirEd""... $ac_c" 1>&6 -echo "configure:7680: checking if you wish to allow "zip" and "unzip" commands from DirEd" >&5 +echo "configure:7696: checking if you wish to allow "zip" and "unzip" commands from DirEd" >&5 # Check whether --enable-dired-zip or --disable-dired-zip was given. if test "${enable_dired_zip+set}" = set; then @@ -7702,7 +7718,7 @@ fi echo "$ac_t""$enableval" 1>&6 echo $ac_n "checking if you wish to allow "gzip" and "gunzip" commands from DirEd""... $ac_c" 1>&6 -echo "configure:7706: checking if you wish to allow "gzip" and "gunzip" commands from DirEd" >&5 +echo "configure:7722: checking if you wish to allow "gzip" and "gunzip" commands from DirEd" >&5 # Check whether --enable-dired-gzip or --disable-dired-gzip was given. if test "${enable_dired_gzip+set}" = set; then @@ -7729,7 +7745,7 @@ fi fi echo $ac_n "checking if you want long-directory listings""... $ac_c" 1>&6 -echo "configure:7733: checking if you want long-directory listings" >&5 +echo "configure:7749: checking if you want long-directory listings" >&5 # Check whether --enable-long-list or --disable-long-list was given. if test "${enable_long_list+set}" = set; then @@ -7755,7 +7771,7 @@ fi echo "$ac_t""$enableval" 1>&6 echo $ac_n "checking if parent-directory references are permitted""... $ac_c" 1>&6 -echo "configure:7759: checking if parent-directory references are permitted" >&5 +echo "configure:7775: checking if parent-directory references are permitted" >&5 # Check whether --enable-parent-dir-refs or --disable-parent-dir-refs was given. if test "${enable_parent_dir_refs+set}" = set; then diff --git a/configure.in b/configure.in index 1d69e632..b86e558f 100644 --- a/configure.in +++ b/configure.in @@ -197,6 +197,11 @@ os2*) LDFLAGS=`echo "$LDFLAGS -Zmt -Zcrtdll" | sed "s/-Zexe//g"` PROG_EXT=".exe" ;; +osf4*) + # The -Olimit flag (see below) is no longer available with + # Digital C 5.2, which is bundled with Digital UNIX 4.0. + CFLAGS="$CFLAGS -DDSYS5" + ;; osf*) # Increase the maximum size of functions that will be optimized. test -z "$GCC" && CFLAGS="$CFLAGS -O -Olimit 4000" diff --git a/src/GridText.c b/src/GridText.c index c2f70164..1dc2d7b8 100644 --- a/src/GridText.c +++ b/src/GridText.c @@ -748,7 +748,7 @@ PRIVATE int display_line ARGS2( #define CStyle line->styles[current_style] while (current_style < line->numstyles && - i >= CStyle.horizpos + line->offset + 1) + i >= (int) (CStyle.horizpos + line->offset + 1)) { LynxChangeStyle (CStyle.style,CStyle.direction,CStyle.previous); current_style++; @@ -3124,7 +3124,7 @@ PRIVATE void remove_special_attr_chars ARGS1( PUBLIC void HText_endAppend ARGS1( HText *, text) { - int cur_line, cur_char, cur_shift, len; + int cur_line, cur_char, cur_shift; TextAnchor *anchor_ptr; HTLine *line_ptr; unsigned char ch; @@ -3275,16 +3275,8 @@ re_parse: anchor_ptr->hightext2offset = line_ptr2->offset; remove_special_attr_chars(anchor_ptr->hightext2); if (anchor_ptr->link_type & HYPERTEXT_ANCHOR) { - if ((len = strlen(anchor_ptr->hightext2)) > 0) { - len--; - while (len >= 0 && - isspace((unsigned char) - anchor_ptr->hightext2[len])) { - anchor_ptr->hightext2[len] = '\0'; - len--; - } - } - if (len <= 0 && anchor_ptr->hightext2[0] == '\0') { + LYTrimTrailing(anchor_ptr->hightext2); + if (anchor_ptr->hightext2[0] == '\0') { FREE(anchor_ptr->hightext2); anchor_ptr->hightext2offset = 0; } @@ -3293,14 +3285,7 @@ re_parse: } remove_special_attr_chars(anchor_ptr->hightext); if (anchor_ptr->link_type & HYPERTEXT_ANCHOR) { - if ((len = strlen(anchor_ptr->hightext)) > 0) { - len--; - while (len >= 0 && - isspace((unsigned char)anchor_ptr->hightext[len])) { - anchor_ptr->hightext[len] = '\0'; - len--; - } - } + LYTrimTrailing(anchor_ptr->hightext); } /* @@ -3736,10 +3721,10 @@ PUBLIC char *HText_getStyle NOARGS * document (normally derived from a Content-Disposition header with * attachment; filename=name.suffix). - FM */ -PUBLIC char * HText_getSugFname NOARGS +PUBLIC CONST char * HText_getSugFname NOARGS { return(HTMainText ? - (char *) HTAnchor_SugFname(HTMainText->node_anchor) : NULL); + HTAnchor_SugFname(HTMainText->node_anchor) : 0); } /* @@ -4408,7 +4393,7 @@ PUBLIC int do_www_search ARGS1( document *, doc) { char searchstring[256], temp[256], *cp, *tmpaddress = NULL; - int ch, recall, i; + int ch, recall; int QueryTotal; int QueryNum; BOOLEAN PreviousSearch = FALSE; @@ -4533,22 +4518,13 @@ get_query: /* * Strip leaders and trailers. - FM */ - cp = searchstring; - while (*cp && isspace((unsigned char)*cp)) - cp++; - if (!(*cp)) { + LYTrimLeading(searchstring); + if (!(*searchstring)) { _statusline(CANCELLED); sleep(InfoSecs); return(NULLFILE); } - if (cp > searchstring) { - for (i = 0; *cp; i++) - searchstring[i] = *cp++; - searchstring[i] = '\0'; - } - cp = searchstring + strlen(searchstring) - 1; - while ((cp > searchstring) && isspace((unsigned char)*cp)) - *cp-- = '\0'; + LYTrimTrailing(searchstring); /* * Don't resubmit the same query unintentionally. @@ -5258,20 +5234,20 @@ PUBLIC char * HText_getRevTitle NOARGS * HText_getContentBase returns the Content-Base header * of the current document. */ -PUBLIC char * HText_getContentBase NOARGS +PUBLIC CONST char * HText_getContentBase NOARGS { return(HTMainText ? - (char *)HTAnchor_content_base(HTMainText->node_anchor) : NULL); + HTAnchor_content_base(HTMainText->node_anchor) : 0); } /* * HText_getContentLocation returns the Content-Location header * of the current document. */ -PUBLIC char * HText_getContentLocation NOARGS +PUBLIC CONST char * HText_getContentLocation NOARGS { return(HTMainText ? - (char *)HTAnchor_content_location(HTMainText->node_anchor) : NULL); + HTAnchor_content_location(HTMainText->node_anchor) : 0); } PUBLIC void HTuncache_current_document NOARGS @@ -5735,11 +5711,9 @@ PUBLIC void HText_beginForm ARGS5( * convert to lowercase and collapse spaces. - kw */ if (accept_cs != NULL) { - int i; StrAllocCopy(HTFormAcceptCharset, accept_cs); - collapse_spaces(HTFormAcceptCharset); - for (i = 0; HTFormAcceptCharset[i]; i++) - HTFormAcceptCharset[i] = TOLOWER(HTFormAcceptCharset[i]); + LYRemoveBlanks(HTFormAcceptCharset); + LYLowerCase(HTFormAcceptCharset); } /* @@ -6559,9 +6533,8 @@ PUBLIC int HText_beginInput ARGS3( */ if (I->accept_cs) { StrAllocCopy(f->accept_cs, I->accept_cs); - collapse_spaces(f->accept_cs); - for (i = 0; f->accept_cs[i]; i++) - f->accept_cs[i] = TOLOWER(f->accept_cs[i]); + LYRemoveBlanks(f->accept_cs); + LYLowerCase(f->accept_cs); } /* diff --git a/src/GridText.h b/src/GridText.h index 265cadd7..2cf7da85 100644 --- a/src/GridText.h +++ b/src/GridText.h @@ -72,7 +72,7 @@ extern int HText_sourceAnchors PARAMS((HText * text)); extern void HText_setStale PARAMS((HText * text)); extern void HText_refresh PARAMS((HText * text)); extern char * HText_getTitle NOPARAMS; -extern char * HText_getSugFname NOPARAMS; +extern CONST char * HText_getSugFname NOPARAMS; extern void HTCheckFnameForCompression PARAMS(( char ** fname, HTParentAnchor * anchor, @@ -81,8 +81,8 @@ extern char * HText_getLastModified NOPARAMS; extern char * HText_getDate NOPARAMS; extern char * HText_getServer NOPARAMS; extern char * HText_getOwner NOPARAMS; -extern char * HText_getContentBase NOPARAMS; -extern char * HText_getContentLocation NOPARAMS; +extern CONST char * HText_getContentBase NOPARAMS; +extern CONST char * HText_getContentLocation NOPARAMS; #ifdef USE_HASH extern char * HText_getStyle NOPARAMS; #endif diff --git a/src/HTAlert.c b/src/HTAlert.c index 74d8d2b8..6e5013e7 100644 --- a/src/HTAlert.c +++ b/src/HTAlert.c @@ -50,7 +50,7 @@ PUBLIC void HTProgress ARGS1( CONST char *, Msg) { if (TRACE) - fprintf(stderr, "%s\n", Msg); + fprintf(tfp, "%s\n", Msg); else statusline(Msg); } diff --git a/src/HTFWriter.c b/src/HTFWriter.c index 6d6fc136..4745f48b 100644 --- a/src/HTFWriter.c +++ b/src/HTFWriter.c @@ -878,7 +878,7 @@ Prepend_BASE: StrAllocCopy(temp, anchor->content_location); } if (temp) { - collapse_spaces(temp); + LYRemoveBlanks(temp); if (!is_url(temp)) { FREE(temp); } @@ -905,8 +905,8 @@ Prepend_BASE: if (anchor->charset && *anchor->charset) { StrAllocCopy(temp, anchor->charset); - collapse_spaces(temp); - fprintf(ret_obj->fp, + LYRemoveBlanks(temp); + fprintf(ret_obj->fp, "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=%s\">\n\n", temp); } diff --git a/src/HTInit.c b/src/HTInit.c index 025a7002..9b79ec04 100644 --- a/src/HTInit.c +++ b/src/HTInit.c @@ -23,6 +23,7 @@ #include <HTSaveToFile.h> /* LJM */ #include <userdefs.h> +#include <LYStrings.h> #include <LYUtils.h> #include <LYGlobalDefs.h> #include <LYSignal.h> @@ -279,27 +280,16 @@ PRIVATE char *GetCommand ARGS2( PRIVATE char *Cleanse ARGS1( char *, s) { - char *tmp, *news; - - /* strip leading white space */ - while (*s && isspace((unsigned char) *s)) - ++s; - news = s; - /* put in lower case */ - for (tmp=s; *tmp; ++tmp) { - *tmp = TOLOWER ((unsigned char)*tmp); - } - /* strip trailing white space */ - while ((tmp > news) && *--tmp && isspace((unsigned char) *tmp)) - *tmp = '\0'; - return(news); + LYTrimLeading(s); + LYTrimTrailing(s); + LYLowerCase(s); + return(s); } PRIVATE int ProcessMailcapEntry ARGS2( FILE *, fp, struct MailcapEntry *, mc) { - int i, j; size_t rawentryalloc = 2000, len; char *rawentry, *s, *t, *LineBuf; @@ -335,8 +325,7 @@ PRIVATE int ProcessMailcapEntry ARGS2( FREE(LineBuf); - for (s = rawentry; *s && isspace((unsigned char) *s); ++s) - ; + s = LYSkipBlanks(rawentry); if (!*s) { /* totally blank entry -- quietly ignore */ FREE(rawentry); @@ -359,12 +348,9 @@ PRIVATE int ProcessMailcapEntry ARGS2( FREE(rawentry); return(0); } - for (i = 0, j = 0; rawentry[i]; i++) { - if (rawentry[i] != ' ') { - rawentry[j++] = TOLOWER(rawentry[i]); - } - } - rawentry[j] = '\0'; + LYRemoveBlanks(rawentry); + LYLowerCase(rawentry); + mc->needsterminal = 0; mc->copiousoutput = 0; mc->needtofree = 1; @@ -381,8 +367,7 @@ PRIVATE int ProcessMailcapEntry ARGS2( if (!t) { goto assign_presentation; } - s = t; - while (s && *s && isspace((unsigned char) *s)) ++s; + s = LYSkipBlanks(t); while (s) { char *arg, *eq, *mallocd_string; @@ -957,7 +942,7 @@ PRIVATE int HTLoadExtensionsConfigFile ARGS1( { char l[MAX_STRING_LEN],w[MAX_STRING_LEN],*ct; FILE *f; - int x, count = 0; + int count = 0; CTRACE(tfp, "HTLoadExtensionsConfigFile: Loading file '%s'.\n", fn); @@ -974,8 +959,7 @@ PRIVATE int HTLoadExtensionsConfigFile ARGS1( if (!ct) outofmem(__FILE__, "HTLoadExtensionsConfigFile"); strcpy(ct,w); - for (x = 0; ct[x]; x++) - ct[x] = TOLOWER(ct[x]); + LYLowerCase(ct); while(l[0]) { HTGetWord(w, l, ' ', '\t'); @@ -984,10 +968,8 @@ PRIVATE int HTLoadExtensionsConfigFile ARGS1( if (!ct) outofmem(__FILE__, "HTLoadExtensionsConfigFile"); - for (x = 0; w[x]; x++) - ext[x+1] = TOLOWER(w[x]); - ext[0] = '.'; - ext[strlen(w)+1] = '\0'; + sprintf(ext, ".%s", w); + LYLowerCase(ext); CTRACE (tfp, "SETTING SUFFIX '%s' to '%s'.\n", ext, ct); diff --git a/src/HTML.c b/src/HTML.c index eb6b7f5b..55b5d1d0 100644 --- a/src/HTML.c +++ b/src/HTML.c @@ -42,6 +42,7 @@ #include <HTNestedList.h> #include <GridText.h> #include <LYSignal.h> +#include <LYStrings.h> #include <LYUtils.h> #include <LYMap.h> #include <LYList.h> @@ -1908,16 +1909,14 @@ PRIVATE void HTML_start_element ARGS6( (!strcasecomp(value[HTML_NOTE_CLASS], "CAUTION") || !strcasecomp(value[HTML_NOTE_CLASS], "WARNING"))) { StrAllocCopy(note, value[HTML_NOTE_CLASS]); - for (i = 0; note[i] != '\0'; i++) - note[i] = TOUPPER(note[i]); + LYUpperCase(note); StrAllocCat(note, ":"); } else if (present && present[HTML_NOTE_ROLE] && value[HTML_NOTE_ROLE] && (!strcasecomp(value[HTML_NOTE_ROLE], "CAUTION") || !strcasecomp(value[HTML_NOTE_ROLE], "WARNING"))) { StrAllocCopy(note, value[HTML_NOTE_ROLE]); - for (i = 0; note[i] != '\0'; i++) - note[i] = TOUPPER(note[i]); + LYUpperCase(note); StrAllocCat(note, ":"); } else { StrAllocCopy(note, "NOTE:"); @@ -3527,7 +3526,7 @@ PRIVATE void HTML_start_element ARGS6( if (present[HTML_APPLET_CODEBASE] && value[HTML_APPLET_CODEBASE] && *value[HTML_APPLET_CODEBASE]) { StrAllocCopy(base, value[HTML_APPLET_CODEBASE]); - collapse_spaces(base); + LYRemoveBlanks(base); TRANSLATE_AND_UNESCAPE_TO_STD(&base); /* * Force it to be a directory. - FM @@ -3959,11 +3958,7 @@ PRIVATE void HTML_start_element ARGS6( if (present && present[HTML_FORM_ENCTYPE] && value[HTML_FORM_ENCTYPE] && *value[HTML_FORM_ENCTYPE]) { StrAllocCopy(enctype, value[HTML_FORM_ENCTYPE]); - /* - * Force the enctype value to all lower case. - FM - */ - for (cp = enctype; *cp; cp++) - *cp = TOLOWER(*cp); + LYLowerCase(enctype); } if (present) { diff --git a/src/LYBookmark.c b/src/LYBookmark.c index 8416563b..21f61a14 100644 --- a/src/LYBookmark.c +++ b/src/LYBookmark.c @@ -484,7 +484,7 @@ PUBLIC void remove_bookmark_link ARGS2( * Explicitly preserve bookmark file mode on Unix. - DSL */ if (stat(filename_buffer, &stat_buf) == 0) { - mode = ((stat_buf.st_mode & 0777) | HIDE_CHMOD); + mode = ((stat_buf.st_mode & 0777) | 0600); /* make it writable */ (void) fclose(nfp); nfp = NULL; (void) chmod(newfile, mode); @@ -547,6 +547,29 @@ PUBLIC void remove_bookmark_link ARGS2( #ifdef DOSPATH remove(filename_buffer); #endif /* DOSPATH */ + +#ifdef UNIX + /* + * By copying onto the bookmark file, rather than renaming it, we + * can preserve the original ownership of the file, provided that + * it is writable by the current process. + * Changed to copy 1998-04-26 -- gil + */ + { char buffer[3072]; + + sprintf(buffer, "%s %s %s && %s %s", + COPY_PATH, newfile, filename_buffer, + RM_PATH, newfile); + + CTRACE(tfp, "remove_bookmark_link: %s\n", buffer); + if( system( buffer ) ) { + _statusline(BOOKTEMP_COPY_FAIL); + sleep(AlertSecs); + } else { + return; + } + } +#else /* UNIX */ if (rename(newfile, filename_buffer) != -1) { #ifdef VMS char VMSfilename[256]; @@ -571,10 +594,11 @@ PUBLIC void remove_bookmark_link ARGS2( * Used to be ODD_RENAME */ #ifdef _WINDOWS - if (errno == ENOTSAM) { + if (errno == ENOTSAM) #else - if (errno == EXDEV) { + if (errno == EXDEV) #endif /* WINDOWS */ + { char buffer[2048]; sprintf(buffer, "%s %s %s", MV_PATH, newfile, filename_buffer); system(buffer); @@ -591,6 +615,7 @@ PUBLIC void remove_bookmark_link ARGS2( perror("renaming the file"); sleep(AlertSecs); } +#endif /* UNIX */ failure: _statusline(BOOKMARK_DEL_FAILED); diff --git a/src/LYCharUtils.c b/src/LYCharUtils.c index c8685b88..41d9bfc1 100644 --- a/src/LYCharUtils.c +++ b/src/LYCharUtils.c @@ -31,6 +31,7 @@ #include <HTNestedList.h> #include <GridText.h> #include <LYSignal.h> +#include <LYStrings.h> #include <LYUtils.h> #include <LYMap.h> #include <LYBookmark.h> @@ -1512,8 +1513,8 @@ PRIVATE char * UCPutUtf8ToBuffer ARGS3(char *, q, UCode_t, code, BOOL, terminate PRIVATE char *hex = "0123456789ABCDEF"; /* - * Any raw 8-bit or multibyte characters already have been - * handled in relation to the display character set + * Any raw 8-bit or multibyte characters already have been + * handled in relation to the display character set * in SGML_character(), including named and numeric entities. * ** This function used for translations HTML special fields inside tags @@ -2204,8 +2205,15 @@ PRIVATE char ** LYUCFullyTranslateString_1 ARGS9( case S_check_name: /* ** Seek the Unicode value for the named entity. + ** + ** !!!! We manually recover the case of '=' terminator which + ** is commonly found on query to CGI-scripts + ** enclosed as href= URLs like "somepath/?x=1&yz=2" + ** Without this dirty fix, submission of such URLs was broken + ** if &yz string happend to be a recognized entity name. - LP */ - if ((code = HTMLGetEntityUCValue(name)) > 0) { + if ( ((code = HTMLGetEntityUCValue(name)) > 0) && + !((cpe == '=') && (stype == st_URL)) ) { state = S_check_uni; break; } @@ -2368,7 +2376,7 @@ PUBLIC void LYHandleMETA ARGS4( char *http_equiv = NULL, *name = NULL, *content = NULL; char *href = NULL, *id_string = NULL, *temp = NULL; char *cp, *cp0, *cp1 = NULL; - int url_type = 0, i; + int url_type = 0; if (!me || !present) return; @@ -2456,8 +2464,7 @@ PUBLIC void LYHandleMETA ARGS4( */ if ((!me->node_anchor->cache_control) && !strcasecomp((http_equiv ? http_equiv : ""), "Cache-Control")) { - for (i = 0; content[i]; i++) - content[i] = TOLOWER(content[i]); + LYLowerCase(content); StrAllocCopy(me->node_anchor->cache_control, content); if (me->node_anchor->no_cache == FALSE) { cp0 = content; @@ -2559,11 +2566,7 @@ PUBLIC void LYHandleMETA ARGS4( NO, NO, YES, st_other); LYTrimHead(content); LYTrimTail(content); - /* - * Force the Content-type value to all lower case. - FM - */ - for (cp = content; *cp; cp++) - *cp = TOLOWER(*cp); + LYLowerCase(content); if ((cp = strstr(content, "text/html;")) != NULL && (cp1 = strstr(content, "charset")) != NULL && @@ -2743,9 +2746,7 @@ PUBLIC void LYHandleMETA ARGS4( /* * Look for the Seconds field. - FM */ - cp = content; - while (*cp && isspace((unsigned char)*cp)) - cp++; + cp = LYSkipBlanks(content); if (*cp && isdigit(*cp)) { cp1 = cp; while (*cp1 && isdigit(*cp1)) @@ -3143,7 +3144,7 @@ PUBLIC void LYHandleSELECT ARGS5( * Let the size be determined by the number of OPTIONs. - FM */ CTRACE(tfp, "LYHandleSELECT: Ignoring SIZE=\"%s\" for SELECT.\n", - (char *)value[HTML_SELECT_SIZE]); + value[HTML_SELECT_SIZE]); #endif /* NOTDEFINED */ } @@ -3332,7 +3333,7 @@ PUBLIC int LYLegitimizeHREF ARGS4( *pound = '\0'; convert_to_spaces(fragment, FALSE); } - collapse_spaces(*href); + LYRemoveBlanks(*href); if (fragment != NULL) { StrAllocCat(*href, fragment); FREE(fragment); @@ -3451,7 +3452,7 @@ PUBLIC void LYCheckForContentBase ARGS1( if (*me->node_anchor->content_base == '\0') return; StrAllocCopy(cp, me->node_anchor->content_base); - collapse_spaces(cp); + LYRemoveBlanks(cp); } else if (me->node_anchor->content_location != NULL) { /* * We didn't have a Content-Base value, but do @@ -3461,7 +3462,7 @@ PUBLIC void LYCheckForContentBase ARGS1( if (*me->node_anchor->content_location == '\0') return; StrAllocCopy(cp, me->node_anchor->content_location); - collapse_spaces(cp); + LYRemoveBlanks(cp); if (!is_url(cp)) { FREE(cp); return; diff --git a/src/LYCookie.c b/src/LYCookie.c index e94da151..6767c023 100644 --- a/src/LYCookie.c +++ b/src/LYCookie.c @@ -706,9 +706,7 @@ PRIVATE void LYProcessSetCookies ARGS6( } while (NumCookies <= 50 && *p) { attr_start = attr_end = value_start = value_end = NULL; - while (*p != '\0' && isspace((unsigned char)*p)) { - p++; - } + p = LYSkipCBlanks(p); /* * Get the attribute name. */ @@ -717,9 +715,7 @@ PRIVATE void LYProcessSetCookies ARGS6( *p != '=' && *p != ';' && *p != ',') p++; attr_end = p; - while (*p != '\0' && isspace((unsigned char)*p)) { - p++; - } + p = LYSkipCBlanks(p); /* * Check for an '=' delimiter, or an 'expires' name followed @@ -739,9 +735,7 @@ PRIVATE void LYProcessSetCookies ARGS6( if (*p == '=') { p++; } - while (*p != '\0' && isspace((unsigned char)*p)) { - p++; - } + p = LYSkipCBlanks(p); /* * Hack alert! We must handle Netscape-style cookies with * "Expires=Mon, 01-Jan-96 13:45:35 GMT" or @@ -803,20 +797,16 @@ PRIVATE void LYProcessSetCookies ARGS6( while (isdigit((unsigned char)*p)) p++; value_end = p; - while (isspace((unsigned char)*p)) - p++; + p = LYSkipCBlanks(p); if (*p == '\0' || *p == ';') break; if (*p == ',') { - cp = (p + 1); - while (*cp != '\0' && isspace((unsigned char)*cp)) - cp++; + cp = LYSkipCBlanks(p + 1); if (*cp != '\0' && isdigit((unsigned char)*cp)) { cp1 = cp; while (isdigit((unsigned char)*cp1)) cp1++; - while (*cp != '\0' && isspace((unsigned char)*cp)) - cp1++; + cp1 = LYSkipCBlanks(cp1); if (*cp1 == '\0' || *cp1 == ',' || *cp1 == ';') { p = cp; continue; @@ -1193,9 +1183,7 @@ PRIVATE void LYProcessSetCookies ARGS6( } while (NumCookies <= 50 && *p) { attr_start = attr_end = value_start = value_end = NULL; - while (*p != '\0' && isspace((unsigned char)*p)) { - p++; - } + p = LYSkipCBlanks(p); /* * Get the attribute name. */ @@ -1204,9 +1192,7 @@ PRIVATE void LYProcessSetCookies ARGS6( *p != '=' && *p != ';' && *p != ',') p++; attr_end = p; - while (*p != '\0' && isspace((unsigned char)*p)) { - p++; - } + p = LYSkipCBlanks(p); /* * Check for an '=' delimiter, or an 'expires' name followed @@ -1222,9 +1208,7 @@ PRIVATE void LYProcessSetCookies ARGS6( if (*p == '=') { p++; } - while (*p != '\0' && isspace((unsigned char)*p)) { - p++; - } + p = LYSkipCBlanks(p); /* * Hack alert! We must handle Netscape-style cookies with * "Expires=Mon, 01-Jan-96 13:45:35 GMT" or @@ -1286,20 +1270,16 @@ PRIVATE void LYProcessSetCookies ARGS6( while (isdigit((unsigned char)*p)) p++; value_end = p; - while (isspace((unsigned char)*p)) - p++; + p = LYSkipCBlanks(p); if (*p == '\0' || *p == ';') break; if (*p == ',') { - cp = (p + 1); - while (*cp != '\0' && isspace((unsigned char)*cp)) - cp++; + cp = LYSkipCBlanks(p + 1); if (*cp != '\0' && isdigit((unsigned char)*cp)) { cp1 = cp; while (isdigit((unsigned char)*cp1)) cp1++; - while (*cp != '\0' && isspace((unsigned char)*cp)) - cp1++; + cp1 = LYSkipCBlanks(cp1); if (*cp1 == '\0' || *cp1 == ',' || *cp1 == ';') { p = cp; continue; diff --git a/src/LYCurses.c b/src/LYCurses.c index 7329fa02..f1a03969 100644 --- a/src/LYCurses.c +++ b/src/LYCurses.c @@ -777,9 +777,9 @@ PUBLIC void start_curses NOARGS { int n; for (n = 0; n < 128; n++) - if (acs_map[n] & 0x80) { - acs_map[n] &= 0xff; - acs_map[n] |= A_ALTCHARSET; + if (ALT_CHAR_SET[n] & 0x80) { + ALT_CHAR_SET[n] &= 0xff; + ALT_CHAR_SET[n] |= A_ALTCHARSET; } } #endif @@ -956,9 +956,7 @@ PUBLIC BOOLEAN setup ARGS1( #endif /* SIGTSTP */ exit(status); } - for (cp = term; *cp != '\0'; cp++) - if (isupper(*cp)) - *cp = TOLOWER(*cp); + LYLowerCase(term); printf("Terminal = %s\n", term); sleep(InfoSecs); diff --git a/src/LYDownload.c b/src/LYDownload.c index 1c939d31..69397f83 100644 --- a/src/LYDownload.c +++ b/src/LYDownload.c @@ -619,9 +619,9 @@ PUBLIC int LYdownload_options ARGS2( tempname(tempfile, NEW_FILE); first = FALSE; #if defined (VMS) || defined (DOSPATH) || defined (__EMX__) - sprintf(download_filename, "file://localhost/%s", tempfile); + sprintf(download_filename, "file://localhost/%s", tempfile); #else - sprintf(download_filename, "file://localhost%s", tempfile); + sprintf(download_filename, "file://localhost%s", tempfile); #endif /* VMS */ #ifdef VMS } else { diff --git a/src/LYForms.c b/src/LYForms.c index 7a66897b..b9d4da25 100644 --- a/src/LYForms.c +++ b/src/LYForms.c @@ -388,7 +388,7 @@ again: case PGDOWN: #ifdef NOTDEFINED case HOME: - case END: + case END_KEY: case FIND_KEY: case SELECT_KEY: #endif /* NOTDEFINED */ diff --git a/src/LYGlobalDefs.h b/src/LYGlobalDefs.h index 8d447861..44c33b37 100644 --- a/src/LYGlobalDefs.h +++ b/src/LYGlobalDefs.h @@ -292,7 +292,7 @@ extern char *URLDomainSuffixes; extern BOOLEAN startfile_ok; extern BOOLEAN LYSelectPopups; /* Cast popups to radio buttons? */ extern BOOLEAN LYUseDefSelPop; /* Command line -popup toggle */ -extern int LYMultiBookmarks; /* Multi bookmark support on? */ +extern BOOLEAN LYMultiBookmarks; /* Multi bookmark support on? */ extern BOOLEAN LYMBMBlocked; /* Force MBM support off? */ extern BOOLEAN LYMBMAdvanced; /* MBM statusline for ADVANCED? */ extern int LYStatusLine; /* Line for statusline() or -1 */ diff --git a/src/LYJump.c b/src/LYJump.c index 3f7910eb..b0a407be 100644 --- a/src/LYJump.c +++ b/src/LYJump.c @@ -237,8 +237,7 @@ check_recall: bp = buf; if (toupper(key) == 'G' && strncmp(buf, "o ", 2) == 0) bp++; - while (isspace(*bp)) - bp++; + bp = LYSkipBlanks(bp); if (*bp == '\0' && !(recall && (ch == UPARROW || ch == DNARROW))) { /* diff --git a/src/LYMain.c b/src/LYMain.c index f1af2f06..dea33847 100644 --- a/src/LYMain.c +++ b/src/LYMain.c @@ -344,7 +344,7 @@ PUBLIC char *URLDomainSuffixes = NULL; PUBLIC BOOLEAN startfile_ok = FALSE; PUBLIC BOOLEAN LYSelectPopups = USE_SELECT_POPUPS; PUBLIC BOOLEAN LYUseDefSelPop = TRUE; /* Command line -popup toggle */ -PUBLIC int LYMultiBookmarks = MULTI_BOOKMARK_SUPPORT; +PUBLIC BOOLEAN LYMultiBookmarks = MULTI_BOOKMARK_SUPPORT; PUBLIC BOOLEAN LYMBMBlocked = BLOCK_MULTI_BOOKMARKS; PUBLIC BOOLEAN LYMBMAdvanced = TRUE; PUBLIC int LYStatusLine = -1; /* Line for statusline() if > -1 */ @@ -388,6 +388,8 @@ PRIVATE BOOLEAN LYPrependBase = FALSE; PRIVATE HTList *LYStdinArgs = NULL; PRIVATE void parse_arg PARAMS((char **arg, int *i)); +PRIVATE void print_help_and_exit PARAMS((int exit_status)); + #ifndef VMS PUBLIC BOOLEAN LYNoCore = NO_FORCED_CORE_DUMP; PRIVATE void FatalProblem PARAMS((int sig)); @@ -730,8 +732,7 @@ else {init_ctrl_break[0] = 1;} } } #ifdef VMS - for (i = 0; lynx_temp_space[i]; i++) - lynx_temp_space[i] = TOLOWER(lynx_temp_space[i]); + LYLowerCase(lynx_temp_space); if (strchr(lynx_temp_space, '/') != NULL) { if ((len = strlen(lynx_temp_space)) == 1) { StrAllocCopy(lynx_temp_space, "sys$scratch:"); @@ -904,11 +905,8 @@ else {init_ctrl_break[0] = 1;} if ((cp = strchr(buf,'=')) != NULL) { StrAllocCopy(lynx_cfg_file, cp+1); } else { - cp = buf; - while (*cp && !isspace((unsigned char)*cp)) - cp++; - while (*cp && isspace((unsigned char)*cp)) - cp++; + cp = LYSkipNonBlanks(buf); + cp = LYSkipBlanks(cp); if (*cp) StrAllocCopy(lynx_cfg_file, cp); } @@ -917,11 +915,8 @@ else {init_ctrl_break[0] = 1;} if ((cp = strchr(buf,'=')) != NULL) { StrAllocCopy(lynx_lss_file, cp+1); } else { - cp = buf; - while (*cp && !isspace((unsigned char)*cp)) - cp++; - while (*cp && isspace((unsigned char)*cp)) - cp++; + cp = LYSkipNonBlanks(buf); + cp = LYSkipBlanks(cp); if (*cp) StrAllocCopy(lynx_cfg_file, cp); } @@ -1042,14 +1037,15 @@ else {init_ctrl_break[0] = 1;} strlen((char *)ANONYMOUS_USER) > 0 && #if defined (VMS) || defined (NOUSERS) !strcasecomp(((char *)getenv("USER")==NULL ? " " : getenv("USER")), - ANONYMOUS_USER)) { + ANONYMOUS_USER)) #else #if HAVE_CUSERID - STREQ((char *)cuserid((char *) NULL), ANONYMOUS_USER)) { + STREQ((char *)cuserid((char *) NULL), ANONYMOUS_USER)) #else - STREQ(((char *)getlogin()==NULL ? " " : getlogin()), ANONYMOUS_USER)) { + STREQ(((char *)getlogin()==NULL ? " " : getlogin()), ANONYMOUS_USER)) #endif /* HAVE_CUSERID */ #endif /* VMS */ + { parse_restrictions("default"); anon_restrictions_set = TRUE; LYUseTraceLog = FALSE; @@ -1296,8 +1292,7 @@ else {init_ctrl_break[0] = 1;} FREE(temp); } #ifdef VMS - for (i = 0; lynx_save_space[i]; i++) - lynx_save_space[i] = TOLOWER(lynx_save_space[i]); + LYLowerCase(lynx_save_space); if (strchr(lynx_save_space, '/') != NULL) { if ((len = strlen(lynx_save_space)) == 1) { StrAllocCopy(lynx_save_space, "sys$login:"); @@ -1756,678 +1751,605 @@ PUBLIC void LYRegisterLynxProtocols NOARGS HTRegisterProtocol(&LYLynxCookies); } +/* There are different ways of setting arguments on the command line, and + * there are different types of arguments. These include: + * + * -set_some_variable ==> some_variable = TRUE + * -toggle_some_variable ==> some_variable = !some_variable + * -some_variable=value ==> some_variable = value + * + * Others are complicated and require a function call. + */ + +struct parse_args_type; +typedef int (*ParseFunc) PARAMS((struct parse_args_type *, char **, char *)); + +typedef union { + BOOLEAN * set_value; + int * int_value; + char ** str_value; + ParseFunc fun_value; +} ParseUnion; + +#undef PARSE_DEBUG + /* - * Parse one argument, optionally picking up the next entry in argv (if - * appropriate). + * Storing the four types of data in separate fields costs about 1K of data. + * However, this provides usable type-checking. The initial version of the + * parse_args_type used 'long' for all types, and dumped core when processing + * "lynx -help". (The compiler was unable to detect some minor errors). */ +#ifdef PARSE_DEBUG +#define ParseData BOOLEAN *set_value; int *int_value; char **str_value; ParseFunc fun_value +#define PARSE_SET(n,t,v,h) {n,t, v, 0, 0, 0, h} +#define PARSE_INT(n,t,v,h) {n,t, 0, &v, 0, 0, h} +#define PARSE_STR(n,t,v,h) {n,t, 0, 0, v, 0, h} +#define PARSE_FUN(n,t,v,h) {n,t, 0, 0, 0, v, h} +#else +#define ParseData long value +#define PARSE_SET(n,t,v,h) {n,t, (long) (v), h} +#define PARSE_INT(n,t,v,h) {n,t, (long)&(v), h} +#define PARSE_STR(n,t,v,h) {n,t, (long) (v), h} +#define PARSE_FUN(n,t,v,h) {n,t, (long) (v), h} +#endif -PRIVATE char * scan3D ARGS2( - char **, argv, - int *, i) +typedef struct parse_args_type { - char *result; - - if ((result=strchr(argv[0],'=')) != NULL) - return result+1; - if (argv[1] && i) - (*i)++; /* Let master know we've stolen an argument */ - return argv[1]; + char *name; + int type; +#define IGNORE_ARG 0x000 +#define TOGGLE_ARG 0x001 +#define SET_ARG 0x002 +#define UNSET_ARG 0x003 +#define FUNCTION_ARG 0x004 +#define LYSTRING_ARG 0x005 +#define INT_ARG 0x006 +#define STRING_ARG 0x007 +#define ARG_TYPE_MASK 0x0FF +#define NEED_NEXT_ARG 0x100 + +#define NEED_INT_ARG (NEED_NEXT_ARG | INT_ARG) +#define NEED_LYSTRING_ARG (NEED_NEXT_ARG | LYSTRING_ARG) +#define NEED_STRING_ARG (NEED_NEXT_ARG | STRING_ARG) +#define NEED_FUNCTION_ARG (NEED_NEXT_ARG | FUNCTION_ARG) + + /* If the NEED_NEXT_ARG flags is set, and the option was not specified + * with an '=' character, then use the next argument in the argv list. + */ + + ParseData; + char *help_string; } +Parse_Args_Type; -PRIVATE void parse_arg ARGS2( - char **, argv, - int *, i) +/* -auth, -pauth */ +static int parse_authentication ARGS2( + char *, next_arg, + char **, result) { - static int ignored; - char *cp; -#ifndef VMS - static char display_putenv_command[142]; -#endif /* !VMS */ -#define nextarg ((cp=scan3D(&argv[0], i))!=NULL) - /* - * Check for a command line startfile. - FM + * Authentication information for protected documents. */ - if (argv[0][0] != '-') { - StrAllocCopy(startfile, argv[0]); - LYTrimHead(startfile); - if (!strncasecomp(startfile, "lynxexec:", 9) || - !strncasecomp(startfile, "lynxprog:", 9)) { - /* - * The original implementations of these schemes expected - * white space without hex escaping, and did not check - * for hex escaping, so we'll continue to support that, - * until that code is redone in conformance with SGML - * principles. - FM - */ - HTUnEscapeSome(startfile, " \r\n\t"); - convert_to_spaces(startfile, TRUE); - } - return; - } + char *auth_info = 0; - /* - * Skip any lone "-" arguments, because we've loaded - * the stdin input into an HTList structure for - * special handling. - FM - */ - if (strcmp(argv[0], "-") == 0) { - return; + if (next_arg != 0) { + StrAllocCopy(auth_info, next_arg); + memset(next_arg, ' ', strlen(next_arg)); /* Let's not show too much */ } - switch (TOLOWER(argv[0][1])) { - - case 'a': - if (strncmp(argv[0], "-anonymous", 10) == 0) { - /* - * Should already have been set, so we don't - * override or replace any additional - * restrictions from the command line. - FM - */ - if (!anon_restrictions_set) - parse_restrictions("default"); - anon_restrictions_set = TRUE; - - } else if ((strncmp(argv[0], "-assume_charset", 15) == 0) || - (strncmp(argv[0], "-assume_local_charset", 21) == 0) || - (strncmp(argv[0], "-assume_unrec_charset", 21) == 0)) { - BOOL local_flag = (argv[0][8] == 'l'); - BOOL unrec_flag = (argv[0][8] == 'u'); + if (auth_info != 0) { + char *cp; - if (nextarg) { - int j; - - for (j = 0; cp[j]; j++) - cp[j] = TOLOWER(cp[j]); - if (local_flag) { - StrAllocCopy(UCAssume_localMIMEcharset, cp); - if (UCAssume_localMIMEcharset && *UCAssume_localMIMEcharset) - UCLYhndl_HTFile_for_unspec = - UCGetLYhndl_byMIME(UCAssume_localMIMEcharset); - } else if (unrec_flag) { - StrAllocCopy(UCAssume_unrecMIMEcharset, cp); - if (UCAssume_unrecMIMEcharset && *UCAssume_unrecMIMEcharset) - UCLYhndl_for_unrec = - UCGetLYhndl_byMIME(UCAssume_unrecMIMEcharset); - } else { - StrAllocCopy(UCAssume_MIMEcharset, cp); - if (UCAssume_MIMEcharset && *UCAssume_MIMEcharset) - UCLYhndl_for_unspec = - UCGetLYhndl_byMIME(UCAssume_MIMEcharset); - } - } else { - if (local_flag) - UCLYhndl_HTFile_for_unspec = 0; - else if (unrec_flag) - UCLYhndl_for_unrec = 0; - else - UCLYhndl_for_unspec = 0; + if ((cp = strchr(auth_info, ':')) != 0) { /* Pw */ + *cp++ = '\0'; /* Terminate ID */ + HTUnEscape(cp); + StrAllocCopy(result[1], cp); } - - } else if (strncmp(argv[0], "-auth", 5) == 0) { - /* - * Authentication information for protected documents. - */ - char *auth_info = NULL; - - if (nextarg) { - StrAllocCopy(auth_info, cp); - memset(cp, ' ', strlen(cp)); /* Let's not show too much */ - } - if (auth_info != NULL) { - if ((cp = strchr(auth_info, ':')) != NULL) { /* Pw */ - *cp++ = '\0'; /* Terminate ID */ - HTUnEscape(cp); - StrAllocCopy(authentication_info[1], cp); - } - if (*auth_info) { /* Id */ - HTUnEscape(auth_info); - StrAllocCopy(authentication_info[0], auth_info); - } - FREE(auth_info); + if (*auth_info) { /* Id */ + HTUnEscape(auth_info); + StrAllocCopy(result[0], auth_info); } + FREE(auth_info); + } + return 0; +} +/* -anonymous */ +static int anonymous_fun ARGS3( + Parse_Args_Type *, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg GCC_UNUSED) +{ + /* + * Should already have been set, so we don't + * override or replace any additional + * restrictions from the command line. - FM + */ + if (!anon_restrictions_set) + parse_restrictions("default"); + anon_restrictions_set = TRUE; + return 0; +} + +/* -assume_charset */ +static int assume_charset_fun ARGS3( + Parse_Args_Type *, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg) +{ + if (next_arg == 0) { + UCLYhndl_for_unspec = 0; } else { - goto Output_Error_and_Help_List; + LYLowerCase(next_arg); + StrAllocCopy(UCAssume_MIMEcharset, next_arg); + if (UCAssume_MIMEcharset && *UCAssume_MIMEcharset) + UCLYhndl_for_unspec = UCGetLYhndl_byMIME(UCAssume_MIMEcharset); } - break; + return 0; +} - case 'b': - if (strcmp(argv[0], "-base") == 0) { - /* - * Treat -source equivalently to an interactive - * download with LYPrefixBaseToSource configured - * to TRUE, so that a BASE tag is prepended for - * text/html content types. We normally treat - * the module-wide global LYPrefixBaseToSource - * flag as FALSE with -source, but force it TRUE, - * later, if LYPrependBase is set TRUE here. - FM - */ - LYPrependBase = TRUE; - if (HTOutputFormat == HTAtom_for("www/dump")) { - HTOutputFormat = HTAtom_for("www/download"); - } +/* -assume_local_charset */ +static int assume_local_charset_fun ARGS3( + Parse_Args_Type *, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg) +{ + if (next_arg == 0) { + UCLYhndl_HTFile_for_unspec = 0; + } else { + LYLowerCase(next_arg); + StrAllocCopy(UCAssume_localMIMEcharset, next_arg); + if (UCAssume_localMIMEcharset && *UCAssume_localMIMEcharset) + UCLYhndl_HTFile_for_unspec = + UCGetLYhndl_byMIME(UCAssume_localMIMEcharset); + } + return 0; +} - } else if (strcmp(argv[0], "-book") == 0) { - /* - * Use bookmarks as startfile. - */ - bookmark_start = TRUE; +/* -assume_unrec_charset */ +static int assume_unrec_charset_fun ARGS3( + Parse_Args_Type *, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg) +{ + if (next_arg == 0) { + UCLYhndl_for_unrec = 0; + } else { + LYLowerCase(next_arg); + StrAllocCopy(UCAssume_unrecMIMEcharset, next_arg); + if (UCAssume_unrecMIMEcharset && *UCAssume_unrecMIMEcharset) + UCLYhndl_for_unrec = UCGetLYhndl_byMIME(UCAssume_unrecMIMEcharset); + } + return 0; +} - } else if (strcmp(argv[0], "-buried_news") == 0) { - /* - * Toggle scans for buried news references. - */ - if (scan_for_buried_news_references) - scan_for_buried_news_references = FALSE; - else - scan_for_buried_news_references = TRUE; +/* -auth */ +static int auth_fun ARGS3( + Parse_Args_Type*, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg) +{ + parse_authentication(next_arg, authentication_info); + return 0; +} -#ifdef USE_SLANG - } else if (strncmp(argv[0], "-blink", 6) == 0) { - Lynx_Color_Flags |= SL_LYNX_USE_BLINK; -#endif /* USE_SLANG */ +/* -base */ +static int base_fun ARGS3( + Parse_Args_Type*, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg GCC_UNUSED) +{ + /* + * Treat -source equivalently to an interactive download with + * LYPrefixBaseToSource configured to TRUE, so that a BASE tag is + * prepended for text/html content types. We normally treat the + * module-wide global LYPrefixBaseToSource flag as FALSE with + * -source, but force it TRUE, later, if LYPrependBase is set + * TRUE here. - FM + */ + LYPrependBase = TRUE; + if (HTOutputFormat == HTAtom_for("www/dump")) + HTOutputFormat = HTAtom_for("www/download"); - } else { - goto Output_Error_and_Help_List; - } - break; + return 0; +} - case 'c': - if (strncmp(argv[0], "-cache", 6) == 0) { - if (nextarg) - HTCacheSize = atoi(cp); - /* - * Limit size. - */ - if (HTCacheSize < 2) HTCacheSize = 2; +#ifdef USE_SLANG +/* -blink */ +static int blink_fun ARGS3( + Parse_Args_Type*, p, + char **, argv, + char *, next_arg) +{ + Lynx_Color_Flags |= SL_LYNX_USE_BLINK; + return 0; +} +#endif - } else if (strncmp(argv[0], "-case", 5) == 0) { - case_sensitive = TRUE; +/* -cache */ +static int cache_fun ARGS3( + Parse_Args_Type*, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg) +{ + if (next_arg != 0) + HTCacheSize = atoi(next_arg); + /* + * Limit size. + */ + if (HTCacheSize < 2) HTCacheSize = 2; - } else if (strncmp(argv[0], "-cfg", 4) == 0) { - /* - * Already read the alternate configuration file - * so just check whether we need to increment i - */ - if (nextarg) - ignored++; /* do nothing */ + return 0; +} - } else if (strncmp(argv[0], "-child", 6) == 0) { - child_lynx = TRUE; - no_disk_save = TRUE; +/* -child */ +static int child_fun ARGS3( + Parse_Args_Type*, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg GCC_UNUSED) +{ + child_lynx = TRUE; + no_disk_save = TRUE; + return 0; +} #ifdef USE_SLANG - } else if (strncmp(argv[0], "-color", 6) == 0) { - Lynx_Color_Flags |= SL_LYNX_USE_COLOR; - if (LYShowColor != SHOW_COLOR_ALWAYS) { - LYShowColor = SHOW_COLOR_ON; - } -#endif /* USE_SLANG */ - - } else if (strncmp(argv[0], "-crawl", 6) == 0) { - crawl = TRUE; - LYcols = 80; +/* -color */ +static int color_fun ARGS3( + Parse_Args_Type*, p, + char **, argv, + char *, next_arg) +{ + Lynx_Color_Flags |= SL_LYNX_USE_COLOR; - } else if (strncmp(argv[0], "-cookies", 8) == 0) { - if (LYSetCookies) - LYSetCookies = FALSE; - else - LYSetCookies = TRUE; + if (LYShowColor != SHOW_COLOR_ALWAYS) + LYShowColor = SHOW_COLOR_ON; -#ifndef VMS - } else if (strncmp(argv[0], "-core", 5) == 0) { - if (LYNoCore) - LYNoCore = FALSE; - else - LYNoCore = TRUE; -#endif /* !VMS */ + return 0; +} +#endif - } else { - goto Output_Error_and_Help_List; - } - break; +/* -crawl */ +static int crawl_fun ARGS3( + Parse_Args_Type*, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg GCC_UNUSED) +{ + crawl = TRUE; + LYcols = 80; + return 0; +} - case 'd': - if (strncmp(argv[0], "-display", 8) == 0) { - if (nextarg) { +/* -display */ +static int display_fun ARGS3( + Parse_Args_Type *, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg) +{ + if (next_arg != 0) { #ifdef VMS - int j; - for (j = 0; cp[j]; j++) - cp[j] = TOUPPER(cp[j]); - Define_VMSLogical(DISPLAY, cp ? cp : ""); + LYUpperCase(next_arg); + Define_VMSLogical(DISPLAY, next_arg); #else - sprintf(display_putenv_command, "DISPLAY=%s", cp ? cp : ""); - putenv(display_putenv_command); -#endif /* VMS */ - if ((cp = getenv(DISPLAY)) != NULL && *cp != '\0') { - StrAllocCopy(display, cp); - } - } + static char display_putenv_command[142]; - } else if (strncmp(argv[0], "-dump", 5) == 0) { - dump_output_immediately = TRUE; - LYcols=80; + sprintf(display_putenv_command, "DISPLAY=%s", next_arg); + putenv(display_putenv_command); +#endif /* VMS */ - } else { - goto Output_Error_and_Help_List; + if ((0 != (next_arg = getenv(DISPLAY))) + && (*next_arg != '\0')) + StrAllocCopy(display, next_arg); } - break; - case 'e': - if (strncmp(argv[0], "-editor", 7) == 0) { - if (nextarg) - StrAllocCopy(editor,cp); - system_editor = TRUE; + return 0; +} - } else if (strncmp(argv[0], "-emacskeys", 10) == 0) { - emacs_keys = TRUE; +/* -dump */ +static int dump_output_fun ARGS3( + Parse_Args_Type *, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg GCC_UNUSED) +{ + dump_output_immediately = TRUE; + LYcols = 80; + return 0; +} - } else if (strncmp(argv[0], "-enable_scrollback", 18) == 0) { - if (enable_scrollback) - enable_scrollback = FALSE; - else - enable_scrollback = TRUE; +/* -editor */ +static int editor_fun ARGS3( + Parse_Args_Type *, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg) +{ + if (next_arg != 0) + StrAllocCopy(editor, next_arg); + system_editor = TRUE; + return 0; +} - } else if (strncmp(argv[0], "-error_file", 11) == 0) { - /* - * Output return (success/failure) code - * of an HTTP transaction. - */ - if (nextarg) - http_error_file = cp; +/* -error_file */ +static int error_file_fun ARGS3( + Parse_Args_Type *, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg) +{ + /* + * Output return (success/failure) code + * of an HTTP transaction. + */ + if (next_arg != 0) + http_error_file = next_arg; + return 0; +} #if defined(EXEC_LINKS) || defined(EXEC_SCRIPTS) - } else if (strncmp(argv[0], "-exec", 5) == 0) { +/* -exec */ +static int exec_fun ARGS3( + Parse_Args_Type*, p, + char **, argv, + char *, next_arg) +{ #ifndef NEVER_ALLOW_REMOTE_EXEC - local_exec = TRUE; + local_exec = TRUE; #else - local_exec_on_local_files = TRUE; + local_exec_on_local_files = TRUE; #endif /* NEVER_ALLOW_REMOTE_EXEC */ -#endif /* EXEC_LINKS || EXEC_SCRIPTS */ - - } else { - goto Output_Error_and_Help_List; - } - break; - - case 'f': - if (strncmp(argv[0], "-force_html", 11) == 0) { - LYforce_HTML_mode = TRUE; - - } else if (strncmp(argv[0], "-fileversions", 13) == 0) { -#ifdef VMS - HTVMSFileVersions = TRUE; -#else - break;; -#endif /* VMS */ - - } else if (strncmp(argv[0], "-force_secure", 13) == 0) { - if (LYForceSSLCookiesSecure) - LYForceSSLCookiesSecure = FALSE; - else - LYForceSSLCookiesSecure = TRUE; - - } else if (strncmp(argv[0], "-from", 5) == 0) { - if (LYNoFromHeader) - LYNoFromHeader = FALSE; - else - LYNoFromHeader = TRUE; - - } else if (strncmp(argv[0], "-ftp", 4) == 0) { - ftp_ok = FALSE; - - } else { - goto Output_Error_and_Help_List; - } - break; + return 0; +} +#endif - case 'g': - if (strcmp(argv[0], "-get_data") == 0) { - /* - * User data for GET form. - */ - char **get_data; - char buf[1024]; +/* -get_data */ +static int get_data_fun ARGS3( + Parse_Args_Type *, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg GCC_UNUSED) +{ + /* + * User data for GET form. + */ + char **get_data; + char buf[1024]; - /* - * On Unix, conflicts with curses when interactive - * so let's force a dump. - CL - * - * On VMS, mods have been made in LYCurses.c to deal with - * potential conflicts, so don't force the dump here. - FM - */ + /* + * On Unix, conflicts with curses when interactive + * so let's force a dump. - CL + * + * On VMS, mods have been made in LYCurses.c to deal with + * potential conflicts, so don't force the dump here. - FM + */ #ifndef VMS - dump_output_immediately = TRUE; - LYcols = 80; + dump_output_immediately = TRUE; + LYcols = 80; #endif /* VMS */ - StrAllocCopy(form_get_data, "?"); /* Prime the pump */ - get_data = &form_get_data; + StrAllocCopy(form_get_data, "?"); /* Prime the pump */ + get_data = &form_get_data; - /* - * Build GET data for later. Stop reading when we see a line - * with "---" as its first three characters. - */ - while (fgets(buf, sizeof(buf), stdin) && - strncmp(buf, "---", 3) != 0) { - int j; + /* + * Build GET data for later. Stop reading when we see a line + * with "---" as its first three characters. + */ + while (fgets(buf, sizeof(buf), stdin) && + strncmp(buf, "---", 3) != 0) { + int j; - for (j = strlen(buf) - 1; j >= 0 && /* Strip line terminators */ - (buf[j] == CR || buf[j] == LF); j--) { - buf[j] = '\0'; - } - StrAllocCat(*get_data, buf); - } + for (j = strlen(buf) - 1; j >= 0 && /* Strip line terminators */ + (buf[j] == CR || buf[j] == LF); j--) + buf[j] = '\0'; - } else { - goto Output_Error_and_Help_List; + StrAllocCat(*get_data, buf); } - break; - case 'h': - if (strcmp(argv[0], "-help") == 0) { - goto Output_Help_List; + return 0; +} - } else if (strcmp(argv[0], "-head") == 0) { - /* - * Return mime headers. - */ - HEAD_request = TRUE; - - } else if (strncmp(argv[0], "-hiddenlinks", 7) == 0) { - if (nextarg) { - if (strncasecomp(cp, "merge", 1) == 0) - LYHiddenLinks = HIDDENLINKS_MERGE; - else if (strncasecomp(cp, "listonly", 1) == 0) - LYHiddenLinks = HIDDENLINKS_SEPARATE; - else if (strncasecomp(cp, "ignore", 1) == 0) - LYHiddenLinks = HIDDENLINKS_IGNORE; - else - goto Output_Error_and_Help_List; - } else - LYHiddenLinks = HIDDENLINKS_MERGE; +/* -help */ +static int help_fun ARGS3( + Parse_Args_Type*, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg GCC_UNUSED) +{ + print_help_and_exit (0); + return 0; +} - } else if (strncmp(argv[0], "-historical", 11) == 0) { - if (historical_comments) - historical_comments = FALSE; +/* -hiddenlinks */ +static int hiddenlinks_fun ARGS3( + Parse_Args_Type *, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg) +{ + if (next_arg != 0) { + if (strncasecomp(next_arg, "merge", 1) == 0) + LYHiddenLinks = HIDDENLINKS_MERGE; + else if (strncasecomp(next_arg, "listonly", 1) == 0) + LYHiddenLinks = HIDDENLINKS_SEPARATE; + else if (strncasecomp(next_arg, "ignore", 1) == 0) + LYHiddenLinks = HIDDENLINKS_IGNORE; else - historical_comments = TRUE; - - } else if (strncmp(argv[0], "-homepage", 9) == 0) { - if (nextarg) { - StrAllocCopy(homepage, cp); - LYTrimHead(homepage); - if (!strncasecomp(homepage, "lynxexec:", 9) || - !strncasecomp(homepage, "lynxprog:", 9)) { - /* - * The original implementations of these schemes expected - * white space without hex escaping, and did not check - * for hex escaping, so we'll continue to support that, - * until that code is redone in conformance with SGML - * principles. - FM - */ - HTUnEscapeSome(homepage, " \r\n\t"); - convert_to_spaces(homepage, TRUE); - } - } + print_help_and_exit (-1); } else { - goto Output_Error_and_Help_List; + LYHiddenLinks = HIDDENLINKS_MERGE; } - break; - case 'i': - if (strncmp(argv[0], "-image_links", 12) == 0) { - if (clickable_images) - clickable_images = FALSE; - else - clickable_images = TRUE; - - } else if (strncmp(argv[0], "-index", 6) == 0) { - if (nextarg) - StrAllocCopy(indexfile, cp); - - } else if (strncmp(argv[0], "-ismap", 6) == 0) { - if (LYNoISMAPifUSEMAP) - LYNoISMAPifUSEMAP = FALSE; - else - LYNoISMAPifUSEMAP = TRUE; + return 0; +} - } else { - goto Output_Error_and_Help_List; +/* -homepage */ +static int homepage_fun ARGS3( + Parse_Args_Type *, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg) +{ + if (next_arg != 0) { + StrAllocCopy(homepage, next_arg); + LYTrimHead(homepage); + if (!strncasecomp(homepage, "lynxexec:", 9) || + !strncasecomp(homepage, "lynxprog:", 9)) { + /* + * The original implementations of these schemes expected + * white space without hex escaping, and did not check + * for hex escaping, so we'll continue to support that, + * until that code is redone in conformance with SGML + * principles. - FM + */ + HTUnEscapeSome(homepage, " \r\n\t"); + convert_to_spaces(homepage, TRUE); + } } - break; - - case 'l': - if (strncmp(argv[0], "-link", 5) == 0) { - if (nextarg) - ccount = atoi(cp); - - } else if (strncmp(argv[0], "-localhost", 10) == 0) { - local_host_only = TRUE; + return 0; +} -#if defined(EXEC_LINKS) || defined(EXEC_SCRIPTS) - } else if (strncmp(argv[0], "-locexec", 8) == 0) { - local_exec_on_local_files = TRUE; -#endif /* EXEC_LINKS || EXEC_SCRIPTS */ +/* -mime_header */ +static int mime_header_fun ARGS3( + Parse_Args_Type *, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg GCC_UNUSED) +{ + /* + * Include mime headers and force source dump. + */ + keep_mime_headers = TRUE; + dump_output_immediately = TRUE; + HTOutputFormat = (LYPrependBase ? + HTAtom_for("www/download") : HTAtom_for("www/dump")); + LYcols = 999; + return 0; +} -#if defined(USE_HASH) - } else if (strncmp(argv[0], "-lss", 4) == 0) { +/* -newschunksize */ +static int newschunksize_fun ARGS3( + Parse_Args_Type *, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg) +{ + if (next_arg != 0) { + HTNewsChunkSize = atoi(next_arg); /* - * Already read the alternate lynx-style file - * so just check whether we need to increment i + * If the new HTNewsChunkSize exceeds the maximum, + * increase HTNewsMaxChunk to this size. - FM */ - if (nextarg) - ignored++; /* do nothing */ -#endif - - } else { - goto Output_Error_and_Help_List; + if (HTNewsChunkSize > HTNewsMaxChunk) + HTNewsMaxChunk = HTNewsChunkSize; } - break; + return 0; +} - case 'm': - if (strcmp(argv[0], "-mime_header") == 0) { +/* -newsmaxchunk */ +static int newsmaxchunk_fun ARGS3( + Parse_Args_Type *, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg) +{ + if (next_arg) { + HTNewsMaxChunk = atoi(next_arg); /* - * Include mime headers and force source dump. + * If HTNewsChunkSize exceeds the new maximum, + * reduce HTNewsChunkSize to this maximum. - FM */ - keep_mime_headers = TRUE; - dump_output_immediately = TRUE; - HTOutputFormat = (LYPrependBase ? - HTAtom_for("www/download") : HTAtom_for("www/dump")); - LYcols=999; - - } else if (strncmp(argv[0], "-minimal", 8) == 0) { - if (minimal_comments) - minimal_comments = FALSE; - else - minimal_comments = TRUE; - - } else { - goto Output_Error_and_Help_List; + if (HTNewsChunkSize > HTNewsMaxChunk) + HTNewsChunkSize = HTNewsMaxChunk; } - break; - - case 'n': - if (strncmp(argv[0], "-newschunksize", 14) == 0) { - if (nextarg) { - HTNewsChunkSize = atoi(cp); - /* - * If the new HTNewsChunkSize exceeds the maximum, - * increase HTNewsMaxChunk to this size. - FM - */ - if (HTNewsChunkSize > HTNewsMaxChunk) { - HTNewsMaxChunk = HTNewsChunkSize; - } - } - - } else if (strncmp(argv[0], "-newsmaxchunk", 13) == 0) { - if (nextarg) { - HTNewsMaxChunk = atoi(cp); - /* - * If HTNewsChunkSize exceeds the new maximum, - * reduce HTNewsChunkSize to this maximum. - FM - */ - if (HTNewsChunkSize > HTNewsMaxChunk) { - HTNewsChunkSize = HTNewsMaxChunk; - } - } - - } else if (strncmp(argv[0], "-nobrowse", 9) == 0) { - HTDirAccess = HT_DIR_FORBID; + return 0; +} - } else if (strncmp(argv[0], "-nocc", 5) == 0) { - LYNoCc = TRUE; +/* -nobrowse */ +static int nobrowse_fun ARGS3( + Parse_Args_Type *, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg GCC_UNUSED) +{ + HTDirAccess = HT_DIR_FORBID; + return 0; +} - } else if (strncmp(argv[0], "-nocolor", 8) == 0) { - LYShowColor = SHOW_COLOR_NEVER; +/* -nocolor */ +static int nocolor_fun ARGS3( + Parse_Args_Type *, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg GCC_UNUSED) +{ + LYShowColor = SHOW_COLOR_NEVER; #ifdef USE_SLANG - Lynx_Color_Flags &= ~SL_LYNX_USE_COLOR; - Lynx_Color_Flags |= SL_LYNX_OVERRIDE_COLOR; + Lynx_Color_Flags &= ~SL_LYNX_USE_COLOR; + Lynx_Color_Flags |= SL_LYNX_OVERRIDE_COLOR; #endif + return 0; +} -#if defined(EXEC_LINKS) || defined(EXEC_SCRIPTS) - } else if (strncmp(argv[0], "-noexec", 7) == 0) { - local_exec = FALSE; -#endif /* EXEC_LINKS || EXEC_SCRIPTS */ - - } else if (strncmp(argv[0], "-nofilereferer", 14) == 0) { - no_filereferer = TRUE; - - } else if (strncmp(argv[0], "-nolist", 7) == 0) { - nolist = TRUE; - - } else if (strncmp(argv[0], "-nolog", 6) == 0) { - error_logging = FALSE; - - } else if (strcmp(argv[0], "-nopause") == 0) { /* No statusline pauses */ - InfoSecs = 0; - MessageSecs = 0; - AlertSecs = 0; - - } else if (strncmp(argv[0], "-noprint", 8) == 0) { - no_print = TRUE; - - } else if (strcmp(argv[0], "-noredir") == 0) { - /* - * Don't follow URL redirections. - */ - no_url_redirection = TRUE; - - } else if (strncmp(argv[0], "-noreferer", 10) == 0) { - LYNoRefererHeader = TRUE; - -#ifdef SOCKS - } else if (strncmp(argv[0], "-nosocks", 8) == 0) { - socks_flag = FALSE; -#endif /* SOCKS */ - - } else if (strncmp(argv[0], "-nostatus", 9) == 0) { - no_statusline = TRUE; - - } else if (strncmp(argv[0], "-number_links", 13) == 0) { - number_links = TRUE; - - } else { - goto Output_Error_and_Help_List; - } - break; - - case 'p': - if (strncmp(argv[0], "-pauth", 6) == 0) { - /* - * Authentication information for protected proxy server. - AJL - */ - char *pauth_info = NULL; - - if (nextarg) { - StrAllocCopy(pauth_info, cp); - memset(cp, ' ', strlen(cp)); /* Let's not show too much */ - } - if (pauth_info != NULL) { - if ((cp = strchr(pauth_info, ':')) != NULL) { /* Pw */ - *cp++ = '\0'; /* Terminate ID */ - HTUnEscape(cp); - StrAllocCopy(proxyauth_info[1], cp); - } - if (*pauth_info) { /* Id */ - HTUnEscape(pauth_info); - StrAllocCopy(proxyauth_info[0], pauth_info); - } - FREE(pauth_info); - } +/* -nopause */ +static int nopause_fun ARGS3( + Parse_Args_Type *, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg GCC_UNUSED) +{ + InfoSecs = 0; + MessageSecs = 0; + AlertSecs = 0; + return 0; +} - } else if (strncmp(argv[0], "-popup", 6) == 0) { - LYUseDefSelPop = FALSE; +/* -pauth */ +static int pauth_fun ARGS3( + Parse_Args_Type*, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg) +{ + parse_authentication(next_arg, proxyauth_info); + return 0; +} - } else if (strcmp(argv[0], "-post_data") == 0) { - /* - * User data for POST form. - */ - char **post_data; - char buf[1024]; +/* -post_data */ +static int post_data_fun ARGS3( + Parse_Args_Type *, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg GCC_UNUSED) +{ + /* + * User data for POST form. + */ + char **post_data; + char buf[1024]; - /* - * On Unix, conflicts with curses when interactive - * so let's force a dump. - CL - * - * On VMS, mods have been made in LYCurses.c to deal with - * potential conflicts, so don't force a dump here. - FM - */ + /* + * On Unix, conflicts with curses when interactive so let's force a dump. + * - CL + * + * On VMS, mods have been made in LYCurses.c to deal with potential + * conflicts, so don't force a dump here. - FM + */ #ifndef VMS - dump_output_immediately = TRUE; - LYcols = 80; + dump_output_immediately = TRUE; + LYcols = 80; #endif /* VMS */ - post_data = &form_post_data; + post_data = &form_post_data; - /* - * Build post data for later. Stop reading when we see a line - * with "---" as its first three characters. - */ - while (fgets(buf, sizeof(buf), stdin) && - strncmp(buf, "---", 3) != 0) { - int j; + /* + * Build post data for later. Stop reading when we see a line with "---" + * as its first three characters. + */ + while (fgets(buf, sizeof(buf), stdin) && + strncmp(buf, "---", 3) != 0) { + int j; - for (j = strlen(buf) - 1; j >= 0 && /* Strip line terminators */ - (buf[j] == CR || buf[j] == LF); j--) { - buf[j] = '\0'; - } - StrAllocCat(*post_data, buf); + for (j = strlen(buf) - 1; j >= 0 && /* Strip line terminators */ + (buf[j] == CR || buf[j] == LF); j--) { + buf[j] = '\0'; } - - } else if (strncmp(argv[0], "-preparsed", 9) == 0) { - LYPreparsedSource = TRUE; - - } else if (strncmp(argv[0], "-print", 6) == 0) { - no_print=FALSE; - - } else if (strncmp(argv[0], "-pseudo_inlines", 15) == 0) { - if (pseudo_inline_alts) - pseudo_inline_alts = FALSE; - else - pseudo_inline_alts = TRUE; - - } else { - goto Output_Error_and_Help_List; + StrAllocCat(*post_data, buf); } - break; - - case 'r': - if (strncmp(argv[0], "-raw", 4) == 0) { - LYUseDefaultRawMode = FALSE; - - } else if (strncmp(argv[0], "-realm", 6) == 0) { - check_realm = TRUE; - - } else if (strncmp(argv[0], "-reload", 7) == 0) { - reloading = TRUE; + return 0; +} - } else if (strncmp(argv[0], "-restrictions", 13) == 0) { - if ((cp=strchr(argv[0],'=')) != NULL) - parse_restrictions(cp+1); - else { - static CONST char *Usage[] = { +/* -restrictions */ +static int restrictions_fun ARGS3( + Parse_Args_Type *, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg) +{ + static CONST char *Usage[] = { "" ," USAGE: lynx -restrictions=[option][,option][,option]" ," List of Options:" @@ -2503,321 +2425,714 @@ PRIVATE void parse_arg ARGS2( ," suspend disallow Control-Z suspends with escape to shell" ," telnet_port disallow specifying a port in telnet G)oto's" ," useragent disallow modifications of the User-Agent header" - }; - size_t n; - for (n = 0; n < sizeof(Usage)/sizeof(Usage[0]); n++) - printf("%s\n", Usage[n]); - exit(0); - } - - } else if (strncmp(argv[0], "-resubmit_posts", 15) == 0) { - if (LYresubmit_posts) - LYresubmit_posts = FALSE; - else - LYresubmit_posts = TRUE; - - } else if (strncmp(argv[0], "-rlogin", 7) == 0) { - rlogin_ok = FALSE; + }; + size_t n; + if (next_arg != 0) { + parse_restrictions(next_arg); } else { - goto Output_Error_and_Help_List; + for (n = 0; n < sizeof(Usage)/sizeof(Usage[0]); n++) + printf("%s\n", Usage[n]); + exit(0); } - break; + return 0; +} - case 's': - if (strncmp(argv[0], "-selective", 10) == 0) { - HTDirAccess = HT_DIR_SELECTIVE; +/* -selective */ +static int selective_fun ARGS3( + Parse_Args_Type *, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg GCC_UNUSED) +{ + HTDirAccess = HT_DIR_SELECTIVE; + return 0; +} - } else if (strncmp(argv[0], "-show_cursor", 12) == 0) { - LYUseDefShoCur = FALSE; +/* -source */ +static int source_fun ARGS3( + Parse_Args_Type *, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg GCC_UNUSED) +{ + dump_output_immediately = TRUE; + HTOutputFormat = (LYPrependBase ? + HTAtom_for("www/download") : HTAtom_for("www/dump")); + LYcols = 999; + return 0; +} - } else if (strncmp(argv[0], "-soft_dquotes", 13) == 0) { - if (soft_dquotes) - soft_dquotes = FALSE; - else - soft_dquotes = TRUE; +/* -tagsoup */ +static int tagsoup_fun ARGS3( + Parse_Args_Type *, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg GCC_UNUSED) +{ + HTSwitchDTD(New_DTD = NO); + return 0; +} + +/* -traversal */ +static int traversal_fun ARGS3( + Parse_Args_Type *, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg GCC_UNUSED) +{ + traversal = TRUE; +#ifdef USE_SLANG + LYcols = 80; +#else + LYcols = 999; +#endif /* USE_SLANG */ - } else if (strncmp(argv[0], "-source", 7) == 0) { - dump_output_immediately = TRUE; - HTOutputFormat = (LYPrependBase ? - HTAtom_for("www/download") : HTAtom_for("www/dump")); - LYcols=999; + return 0; +} - } else if (strncmp(argv[0], "-stack_dump", 11) == 0) { - stack_dump = TRUE; +/* -version */ +static int version_fun ARGS3( + Parse_Args_Type *, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg GCC_UNUSED) +{ + printf("\n%s Version %s (1998)\n", LYNX_NAME, LYNX_VERSION); + printf( + "Copyrights held by the University of Kansas, CERN, and other contributors.\n" + ); + printf("Distributed under the GNU General Public License.\n"); + printf( + "See http://lynx.browser.org/ and the online help for more information.\n\n" + ); + exit(0); + /* NOT REACHED */ + return 0; +} + +/* -width */ +static int width_fun ARGS3( + Parse_Args_Type*, p GCC_UNUSED, + char **, argv GCC_UNUSED, + char *, next_arg) +{ + if (next_arg != 0) { + int w = atoi(next_arg); + if (w > 0) + dump_output_width = ((w < 999) ? w : 999); + } - } else if (strncmp(argv[0], "-startfile_ok", 13) == 0) { - startfile_ok = TRUE; + return 0; +} +static Parse_Args_Type Arg_Table [] = +{ + PARSE_FUN( + "anonymous", FUNCTION_ARG, anonymous_fun, + "used to specify the anonymous account" + ), + PARSE_FUN( + "assume_charset", NEED_FUNCTION_ARG, assume_charset_fun, + "=MIMEname\ncharset for documents that don't specify it" + ), + PARSE_FUN( + "assume_local_charset", NEED_FUNCTION_ARG,assume_local_charset_fun, + "=MIMEname\ncharset assumed for local files" + ), + PARSE_FUN( + "assume_unrec_charset", NEED_FUNCTION_ARG,assume_unrec_charset_fun, + "=MIMEname\nuse this instead of unrecognized charsets" + ), + PARSE_FUN( + "auth", NEED_FUNCTION_ARG, auth_fun, + "=id:pw\nauthentication information for protected documents" + ), + PARSE_FUN( + "base", FUNCTION_ARG, base_fun, + "prepend a request URL comment and BASE tag to text/html\noutputs for -source dumps" + ), +#ifdef USE_SLANG + PARSE_FUN( + "blink", FUNCTION_ARG, blink_fun, + "force high intensity bg colors in color mode" + ), +#endif + PARSE_SET( + "book", SET_ARG, &bookmark_start, + "use the bookmark page as the startfile" + ), + PARSE_SET( + "buried_news", TOGGLE_ARG, &scan_for_buried_news_references, + "toggles scanning of news articles for buried references" + ), + PARSE_FUN( + "cache", NEED_FUNCTION_ARG, cache_fun, + "=NUMBER\nNUMBER of documents cached in memory" + ), + PARSE_SET( + "case", SET_ARG, &case_sensitive, + "enable case sensitive user searching" + ), + PARSE_STR( + "cfg", IGNORE_ARG|NEED_NEXT_ARG, 0, + "=FILENAME\nspecifies a lynx.cfg file other than the default" + ), + PARSE_FUN( + "child", FUNCTION_ARG, child_fun, + "exit on left-arrow in startfile, and disable save to disk" + ), +#ifdef USE_SLANG + PARSE_FUN( + "color", FUNCTION_ARG, color_fun, + "force color mode on with standard bg colors" + ), +#endif + PARSE_SET( + "cookies", TOGGLE_ARG, &LYSetCookies, + "toggles handling of Set-Cookie headers" + ), +#ifndef VMS + PARSE_SET( + "core", TOGGLE_ARG, &LYNoCore, + "toggles forced core dumps on fatal errors" + ), +#endif + PARSE_FUN( + "crawl", FUNCTION_ARG, crawl_fun, + "with -traversal, output each page to a file\n\ +with -dump, format output as with -traversal, but to stdout" + ), + PARSE_FUN( + "display", NEED_FUNCTION_ARG, display_fun, + "=DISPLAY\nset the display variable for X exec'ed programs" + ), + PARSE_FUN( + "dump", FUNCTION_ARG, dump_output_fun, + "dump the first file to stdout and exit" + ), + PARSE_FUN( + "editor", NEED_FUNCTION_ARG, editor_fun, + "=EDITOR\nenable edit mode with specified editor" + ), + PARSE_SET( + "emacskeys", SET_ARG, &emacs_keys, + "enable emacs-like key movement" + ), + PARSE_SET( + "enable_scrollback", TOGGLE_ARG, &enable_scrollback, + "\ntoggles compatibility with comm programs' scrollback\n\ +keys (may be incompatible with some curses packages)" + ), + PARSE_FUN( + "error_file", NEED_FUNCTION_ARG, error_file_fun, + "=FILE\nwrite the HTTP status code here" + ), +#if defined(EXEC_LINKS) || defined(EXEC_SCRIPTS) +#ifndef NEVER_ALLOW_REMOTE_EXEC + PARSE_FUN( + "exec", FUNCTION_ARG, exec_fun, + "enable local program execution" + ), +#endif + PARSE_SET( + "locexec", SET_ARG, &local_exec_on_local_files, + "enable local program execution from local files only" + ), + PARSE_SET( + "noexec", UNSET_ARG, &local_exec, + "disable local program execution (DEFAULT)" + ), +#endif /* EXEC_LINKS || EXEC_SCRIPTS */ +#ifdef VMS + PARSE_SET( + "fileversions", SET_ARG, &HTVMSFileVersions, + "include all versions of files in local VMS directory\nlistings" + ), +#endif + PARSE_SET( + "force_html", SET_ARG, &LYforce_HTML_mode, + "forces the first document to be interpreted as HTML" + ), + PARSE_SET( + "force_secure", TOGGLE_ARG, &LYForceSSLCookiesSecure, + "toggles forcing of the secure flag for SSL cookies" + ), + PARSE_SET( + "from", TOGGLE_ARG, &LYNoFromHeader, + "toggle transmissions of From headers" + ), + PARSE_SET( + "ftp", UNSET_ARG, &ftp_ok, + "disable ftp access" + ), + PARSE_FUN( + "get_data", FUNCTION_ARG, get_data_fun, + "user data for get forms, read from stdin,\nterminated by '---' on a line" + ), + PARSE_SET( + "head", SET_ARG, &HEAD_request, + "send a HEAD request" + ), + PARSE_FUN( + "help", FUNCTION_ARG, help_fun, + "print this usage message" + ), + PARSE_FUN( + "hiddenlinks", NEED_FUNCTION_ARG, hiddenlinks_fun, + "=[option]\nhidden links: options are merge, listonly, or ignore" + ), + PARSE_SET( + "historical", TOGGLE_ARG, &historical_comments, + "toggles use of '>' or '-->' as a terminator for comments" + ), + PARSE_FUN( + "homepage", NEED_FUNCTION_ARG, homepage_fun, + "=URL\nset homepage separate from start page" + ), + PARSE_SET( + "image_links", TOGGLE_ARG, &clickable_images, + "toggles inclusion of links for all images" + ), + PARSE_STR( + "index", NEED_LYSTRING_ARG, &indexfile, + "=URL\nset the default index file to URL" + ), + PARSE_SET( + "ismap", TOGGLE_ARG, &LYNoISMAPifUSEMAP, + "toggles inclusion of ISMAP links when client-side\nMAPs are present" + ), + PARSE_INT( + "link", NEED_INT_ARG, ccount, + "=NUMBER\nstarting count for lnk#.dat files produced by -crawl" + ), + PARSE_SET( + "localhost", SET_ARG, &local_host_only, + "disable URLs that point to remote hosts" + ), +#if defined(USE_HASH) + PARSE_STR( + "lss", IGNORE_ARG|NEED_NEXT_ARG, 0, + "=FILENAME\nspecifies a lynx.css file other than the default" + ), +#endif + PARSE_FUN( + "mime_header", FUNCTION_ARG, mime_header_fun, + "include mime headers and force source dump" + ), + PARSE_SET( + "minimal", TOGGLE_ARG, &minimal_comments, + "toggles minimal versus valid comment parsing" + ), + PARSE_FUN( + "newschunksize", NEED_FUNCTION_ARG, newschunksize_fun, + "=NUMBER\nnumber of articles in chunked news listings" + ), + PARSE_FUN( + "newsmaxchunk", NEED_FUNCTION_ARG, newsmaxchunk_fun, + "=NUMBER\nmaximum news articles in listings before chunking" + ), + PARSE_FUN( + "nobrowse", FUNCTION_ARG, nobrowse_fun, + "disable directory browsing" + ), + PARSE_SET( + "nocc", SET_ARG, &LYNoCc, + "disable Cc: prompts for self copies of mailings" + ), + PARSE_FUN( + "nocolor", FUNCTION_ARG, nocolor_fun, + "turn off color support" + ), + PARSE_SET( + "nofilereferer", SET_ARG, &no_filereferer, + "disable transmissions of Referer headers for file URLs" + ), + PARSE_SET( + "nolist", SET_ARG, &nolist, + "disable the link list feature in dumps" + ), + PARSE_SET( + "nolog", UNSET_ARG, &error_logging, + "disable mailing of error messages to document owners" + ), + PARSE_FUN( + "nopause", FUNCTION_ARG, nopause_fun, + "disable forced pauses for statusline messages" + ), + PARSE_SET( + "noprint", SET_ARG, &no_print, + "disable print functions" + ), + PARSE_SET( + "noredir", SET_ARG, &no_url_redirection, + "don't follow Location: redirection" + ), + PARSE_SET( + "noreferer", SET_ARG, &LYNoRefererHeader, + "disable transmissions of Referer headers" + ), +#ifdef SOCKS + PARSE_SET( + "nosocks", UNSET_ARG, &socks_flag, + "don't use SOCKS proxy for this session" + ), +#endif + PARSE_SET( + "nostatus", SET_ARG, &no_statusline, + "disable the miscellaneous information messages" + ), + PARSE_SET( + "number_links", SET_ARG, &number_links, + "force numbering of links" + ), + PARSE_FUN( + "pauth", NEED_FUNCTION_ARG, pauth_fun, + "=id:pw\nauthentication information for protected proxy server" + ), + PARSE_SET( + "popup", UNSET_ARG, &LYUseDefSelPop, + "toggles handling of single-choice SELECT options via\npopup windows or as lists of radio buttons" + ), + PARSE_FUN( + "post_data", FUNCTION_ARG, post_data_fun, + "user data for post forms, read from stdin,\nterminated by '---' on a line" + ), + PARSE_SET( + "preparsed", SET_ARG, &LYPreparsedSource, + "show parsed text/html with -source and in source view" + ), + PARSE_SET( + "print", UNSET_ARG, &no_print, + "enable print functions (DEFAULT)" + ), + PARSE_SET( + "pseudo_inlines", TOGGLE_ARG, &pseudo_inline_alts, + "toggles pseudo-ALTs for inlines with no ALT string" + ), + PARSE_SET( + "raw", UNSET_ARG, &LYUseDefaultRawMode, + "toggles default setting of 8-bit character translations\nor CJK mode for the startup character set" + ), + PARSE_SET( + "realm", SET_ARG, &check_realm, + "restricts access to URLs in the starting realm" + ), + PARSE_SET( + "reload", SET_ARG, &reloading, + "flushes the cache on a proxy server\n(only the first document affected)" + ), + PARSE_FUN( + "restrictions", FUNCTION_ARG, restrictions_fun, + "=[options]\nuse -restrictions to see list" + ), + PARSE_SET( + "resubmit_posts", TOGGLE_ARG, &LYresubmit_posts, + "toggles forced resubmissions (no-cache) of forms with\n\ +method POST when the documents they returned are sought\n\ +with the PREV_DOC command or from the History List" + ), + PARSE_SET( + "rlogin", UNSET_ARG, &rlogin_ok, + "disable rlogins" + ), + PARSE_FUN( + "selective", FUNCTION_ARG, selective_fun, + "require .www_browsable files to browse directories" + ), + PARSE_SET( + "show_cursor", UNSET_ARG, &LYUseDefShoCur, + "toggles hiding of the cursor in the lower right corner" + ), + PARSE_SET( + "soft_dquotes", TOGGLE_ARG, &soft_dquotes, + "toggles emulation of the old Netscape and Mosaic bug which\n\ +treated '>' as a co-terminator for double-quotes and tags" + ), + PARSE_FUN( + "source", FUNCTION_ARG, source_fun, + "dump the source of the first file to stdout and exit" + ), + PARSE_SET( + "stack_dump", SET_ARG, &stack_dump, + "disable SIGINT cleanup handler" + ), + PARSE_SET( + "startfile_ok", SET_ARG, &startfile_ok, + "allow non-http startfile and homepage with -validate" + ), #ifndef VMS #ifdef SYSLOG_REQUESTED_URLS - } else if (strncmp(argv[0], "-syslog", 7) == 0) { - if (nextarg) - StrAllocCopy(syslog_txt, cp); -#endif /* SYSLOG_REQUESTED_URLS */ -#endif /* !VMS */ + PARSE_STR( + "syslog", NEED_LYSTRING_ARG, syslog_txt, + "=text\ninformation for syslog call" + ), +#endif +#endif + PARSE_FUN( + "tagsoup", FUNCTION_ARG, tagsoup_fun, + "use TagSoup rather than SortaSGML parser" + ), + PARSE_SET( + "telnet", UNSET_ARG, &telnet_ok, + "disable telnets" + ), + PARSE_STR( + "term", NEED_STRING_ARG, &terminal, + "=TERM\nset terminal type to TERM" + ), + PARSE_SET( + "tlog", IGNORE_ARG, 0, + "toggles use of a Lynx Trace Log for the current session" + ), + PARSE_SET( + "trace", IGNORE_ARG, 0, + "turns on Lynx trace mode" + ), + PARSE_FUN( + "traversal", FUNCTION_ARG, traversal_fun, + "traverse all http links derived from startfile" + ), + PARSE_SET( + "underscore", TOGGLE_ARG, &use_underscore, + "toggles use of _underline_ format in dumps" + ), +#if defined(NCURSES_MOUSE_VERSION) || defined(USE_SLANG_MOUSE) + PARSE_SET( + "use_mouse", SET_ARG, &LYUseMouse, + "turn on xterm mouse support" + ), +#endif + PARSE_STR( + "useragent", NEED_LYSTRING_ARG, &LYUserAgent, + "=Name\nset alternate Lynx User-Agent header" + ), + PARSE_SET( + "validate", IGNORE_ARG, 0, + "accept only http URLs (for validation)" + ), + PARSE_FUN( + "version", FUNCTION_ARG, version_fun, + "print Lynx version information" + ), + PARSE_SET( + "vikeys", SET_ARG, &vi_keys, + "enable vi-like key movement" + ), + PARSE_FUN( + "width", NEED_FUNCTION_ARG, width_fun, + "=NUMBER\nscreen width for formatting of dumps (default is 80)" + ), + {NULL} +}; + +static void print_help_strings ARGS2( + char *, name, + char *, help) +{ + int pad; + int c; + int first; + int field_width = 21; + pad = field_width - (5 + (int) strlen (name)); + + fprintf (stdout, " -%s", name); + + if (*help != '=') { + pad--; + while (pad > 0) { + fputc (' ', stdout); + pad--; + } + fputc (' ', stdout); /* at least one space */ + first = 0; } else { - goto Output_Error_and_Help_List; + first = pad; } - break; - case 't': - if (strncmp(argv[0], "-tagsoup", 8) == 0) { - HTSwitchDTD(New_DTD = NO); + if (strchr (help, '\n') == 0) { + fprintf (stdout, "%s\n", help); + } else { + while ((c = *help) != 0) { + if (c == '\n') { + if ((pad = --first) < 0) { + pad = field_width; + } else { + c = ' '; + } + fputc (c, stdout); + while (pad--) + fputc (' ', stdout); + } else { + fputc (c, stdout); + } + help++; + first--; + } + fputc ('\n', stdout); + } +} - } else if (strncmp(argv[0], "-telnet", 7) == 0) { - telnet_ok = FALSE; +static void print_help_and_exit ARGS1(int, exit_status) +{ + Parse_Args_Type *p; - } else if (strncmp(argv[0], "-term", 5) == 0) { - if (nextarg) - terminal = cp; + if (pgm == NULL) pgm = "lynx"; - } else if (strncmp(argv[0], "-tlog", 5) == 0) { - /* - * Already handled. - FM - */ - break; + fprintf (stdout, "USAGE: %s [options] [file]\n", pgm); + fprintf (stdout, "Options are:\n"); + print_help_strings("", +"receive the arguments from stdin (enclose\n\ +in double-quotes (\"-\") on VMS)"); - } else if (strncmp(argv[0], "-trace", 6) == 0) { - /* - * Already handled. - FM - */ - break; + for (p = Arg_Table; p->name != 0; p++) + print_help_strings(p->name, p->help_string); - } else if (strncmp(argv[0], "-traversal", 10) == 0) { - traversal = TRUE; -#ifdef USE_SLANG - LYcols=80; -#else - LYcols=999; -#endif /* USE_SLANG */ + exit (exit_status); +} - } else { - goto Output_Error_and_Help_List; - } - break; +/* + * This function performs a string comparison on two strings a and b. a is + * assumed to be an ordinary null terminated string, but b may be terminated + * by an '=' character. If terminated by '=', *c will be pointed to the + * character following the '='. + * If a and b match, it returns 1. Otherwise 0 is returned. + */ +static int arg_eqs_parse (char *a, char *b, char **c) +{ + while (1) + { + if (*a != *b) + { + if ((*a == 0) && (*b == '=')) + { + *c = b + 1; + return 1; + } + return 0; + } + + if (*a == 0) + { + *c = 0; + return 1; + } + + a++; + b++; + } +} - case 'u': - if (strncmp(argv[0], "-underscore", 11) == 0) { - if (use_underscore) - use_underscore = FALSE; - else - use_underscore = TRUE; - } else if (strncmp(argv[0], "-useragent", 10) == 0) { - /* - * Set alternate Lynx User-Agent header. - */ - if (nextarg) - StrAllocCopy(LYUserAgent, cp); +PRIVATE void parse_arg ARGS2( + char **, argv, + int *, i) +{ + Parse_Args_Type *p; + char *arg_name; + + arg_name = argv[0]; -#if defined(NCURSES_MOUSE_VERSION) || defined(USE_SLANG_MOUSE) - } else if (strncmp(argv[0], "-use_mouse", 9) == 0) { - LYUseMouse = TRUE; -#endif - } else { - goto Output_Error_and_Help_List; + /* + * Check for a command line startfile. - FM + */ + if (*arg_name != '-') { + StrAllocCopy(startfile, arg_name); + LYTrimHead(startfile); + if (!strncasecomp(startfile, "lynxexec:", 9) || + !strncasecomp(startfile, "lynxprog:", 9)) { + /* + * The original implementations of these schemes expected + * white space without hex escaping, and did not check + * for hex escaping, so we'll continue to support that, + * until that code is redone in conformance with SGML + * principles. - FM + */ + HTUnEscapeSome(startfile, " \r\n\t"); + convert_to_spaces(startfile, TRUE); + } + return; } - break; - case 'v': - if (strcmp(argv[0], "-validate") == 0) { - /* - * Follow only http URLs. - * Already handled. - FM - */ - break; - - } else if (strncmp(argv[0], "-version", 8) == 0) { - printf("\n%s Version %s (1998)\n", LYNX_NAME, LYNX_VERSION); - printf( - "Copyrights held by the University of Kansas, CERN, and other contributors.\n" - ); - printf("Distributed under the GNU General Public License.\n"); - printf( - "See http://lynx.browser.org/ and the online help for more information.\n\n" - ); - exit(0); + /* lose the first '-' character */ + arg_name++; + + /* + * Skip any lone "-" arguments, because we've loaded + * the stdin input into an HTList structure for + * special handling. - FM + */ + if (*arg_name == 0) + return; - } else if (strncmp(argv[0], "-vikeys", 7) == 0) { - vi_keys = TRUE; + p = Arg_Table; + while (p->name != 0) { +#ifdef PARSE_DEBUG + Parse_Args_Type *q = p; +#else + ParseUnion *q = (ParseUnion *)(&(p->value)); +#endif + ParseFunc fun; + char *next_arg; - } else { - goto Output_Error_and_Help_List; - } - break; + if ((p->name[0] != *arg_name) + || (0 == arg_eqs_parse (p->name, arg_name, &next_arg))) { + p++; + continue; + } - case 'w': - if (strncmp(argv[0], "-width", 2) == 0) { - if (nextarg) { - int w = atoi(cp); - if (w > 0) { - dump_output_width = ((w < 999) ? w : 999); - break; - } + if ((p->type & NEED_NEXT_ARG) && (next_arg == 0)) { + next_arg = argv[1]; + if ((i != 0) && (next_arg != 0)) + (*i)++; } - dump_output_width = 80; - } else { - goto Output_Error_and_Help_List; + + switch (p->type & ARG_TYPE_MASK) { + case TOGGLE_ARG: + if (q->set_value != 0) + *(q->set_value) = !(*(q->set_value)); + break; + + case SET_ARG: + if (q->set_value != 0) + *(q->set_value) = TRUE; + break; + + case UNSET_ARG: + if (q->set_value != 0) + *(q->set_value) = FALSE; + break; + + case FUNCTION_ARG: + fun = q->fun_value; + if (0 != fun) { + if (-1 == (*fun) (p, argv, next_arg)) { + } + } + break; + + case LYSTRING_ARG: + if ((q->str_value != 0) && (next_arg != 0)) + StrAllocCopy(*(q->str_value), next_arg); + break; + + case INT_ARG: + if ((q->int_value != 0) && (next_arg != 0)) + *(q->int_value) = atoi (next_arg); + break; + + case STRING_ARG: + if ((q->str_value != 0) && (next_arg != 0)) + *(q->str_value) = next_arg; + break; + + case IGNORE_ARG: + break; + } + + return; } - break; - default: -Output_Error_and_Help_List: -#ifdef VMS - printf(" LYNX: Invalid Option: %s\n", argv[0]); -#else -#ifdef UNIX - if (strncmp(argv[0], "-help", 5) != 0) - fprintf(stderr, "%s: Invalid Option: %s\n", pgm, argv[0]); - else -#endif /* UNIX */ - printf("%s: Invalid Option: %s\n", pgm, argv[0]); -#endif /* VMS */ -Output_Help_List: -#ifdef VMS - printf("USAGE: lynx [options] [file]\n"); -#else - printf("USAGE: %s [options] [file]\n",pgm); -#endif /* VMS */ - { - static CONST char *Options[] = { - "Options are:" -," - receive the arguments from stdin (enclose" -," in double-quotes (\"-\") on VMS)" -," -anonymous used to specify the anonymous account" -," -assume_charset=MIMEname charset for documents that don't specify it" -," -assume_local_charset=MIMEname charset assumed for local files" -," -assume_unrec_charset=MIMEname use this instead of unrecognized charsets" -," -auth=id:pw authentication information for protected documents" -," -base prepend a request URL comment and BASE tag to text/html" -," outputs for -source dumps" -," -book use the bookmark page as the startfile" -," -buried_news toggles scanning of news articles for buried references" -," -cache=NUMBER NUMBER of documents cached in memory" -," -case enable case sensitive user searching" -," -cfg=FILENAME specifies a lynx.cfg file other than the default" -," -child exit on left-arrow in startfile, and disable save to disk" -#ifdef USE_SLANG -," -color force color mode on with standard bg colors" -," -blink force high intensity bg colors in color mode" -#endif /* USE_SLANG */ -," -cookies toggles handling of Set-Cookie headers" -#ifndef VMS -," -core toggles forced core dumps on fatal errors" -#endif /* !VMS */ -," -crawl with -traversal, output each page to a file" -," with -dump, format output as with -traversal, but to stdout" -," -display=DISPLAY set the display variable for X execed programs" -," -dump dump the first file to stdout and exit" -," -editor=EDITOR enable edit mode with specified editor" -," -emacskeys enable emacs-like key movement" -," -enable_scrollback toggles compatibility with comm programs' scrollback" -," keys (may be incompatible with some curses packages)" -," -error_file=FILE write the HTTP status code here" -#if defined(EXEC_LINKS) || defined(EXEC_SCRIPTS) -#ifndef NEVER_ALLOW_REMOTE_EXEC -," -exec enable local program execution" -#endif /* !NEVER_ALLOW_REMOTE_EXEC */ -," -locexec enable local program execution from local files only" -," -noexec disable local program execution (DEFAULT)" -#endif /* EXEC_LINKS || EXEC_SCRIPTS */ -," -fileversions include all versions of files in local VMS directory" -," listings" -," -force_html forces the first document to be interpreted as HTML" -," -force_secure toggles forcing of the secure flag for SSL cookies" -," -from toggle transmissions of From headers" -," -ftp disable ftp access" -," -get_data user data for get forms, read from stdin," -," terminated by '---' on a line" -," -head send a HEAD request" -," -help print this usage message" -," -hiddenlinks=[option] hidden links: options are merge, listonly, or ignore" -," -historical toggles use of '>' or '-->' as a terminator for comments" -," -homepage=URL set homepage separate from start page" -," -image_links toggles inclusion of links for all images" -," -index=URL set the default index file to URL" -," -ismap toggles inclusion of ISMAP links when client-side" -," MAPs are present" -," -link=NUMBER starting count for lnk#.dat files produced by -crawl" -," -localhost disable URLs that point to remote hosts" -#if defined(USE_HASH) -," -lss=FILENAME specifies a lynx.css file other than the default" -#endif -," -mime_header include mime headers and force source dump" -," -minimal toggles minimal versus valid comment parsing" -," -newschunksize=NUMBER number of articles in chunked news listings" -," -newsmaxchunk=NUMBER maximum news articles in listings before chunking" -," -nobrowse disable directory browsing" -," -nocc disable Cc: prompts for self copies of mailings" -," -nofilereferer disable transmissions of Referer headers for file URLs" -," -nolist disable the link list feature in dumps" -," -nolog disable mailing of error messages to document owners" -," -nopause disable forced pauses for statusline messages" -," -noprint disable print functions" -," -noredir don't follow Location: redirection" -," -noreferer disable transmissions of Referer headers" -#ifdef SOCKS -," -nosocks don't use SOCKS proxy for this session" -#endif /* SOCKS */ -," -nostatus disable the miscellaneous information messages" -," -number_links force numbering of links" -," -pauth=id:pw authentication information for protected proxy server" -," -popup toggles handling of single-choice SELECT options via" -," popup windows or as lists of radio buttons" -," -post_data user data for post forms, read from stdin," -," terminated by '---' on a line" -," -preparsed show parsed text/html with -source and in source view" -," -print enable print functions (DEFAULT)" -," -pseudo_inlines toggles pseudo-ALTs for inlines with no ALT string" -," -raw toggles default setting of 8-bit character translations" -," or CJK mode for the startup character set" -," -realm restricts access to URLs in the starting realm" -," -reload flushes the cache on a proxy server" -," (only the first document affected)" -," -restrictions=[options] use -restrictions to see list" -," -resubmit_posts toggles forced resubmissions (no-cache) of forms with" -," method POST when the documents they returned are sought" -," with the PREV_DOC command or from the History List" -," -rlogin disable rlogins" -," -selective require .www_browsable files to browse directories" -," -show_cursor toggles hiding of the cursor in the lower right corner" -," -soft_dquotes toggles emulation of the old Netscape and Mosaic bug which" -," treated '>' as a co-terminator for double-quotes and tags" -," -source dump the source of the first file to stdout and exit" -," -startfile_ok allow non-http startfile and homepage with -validate" -#ifndef VMS -#ifdef SYSLOG_REQUESTED_URLS -," -syslog=text information for syslog call" -#endif /* SYSLOG_REQUESTED_URLS */ -#endif /* !VMS */ -," -tagsoup use TagSoup rather than SortaSGML parser" -," -telnet disable telnets" -," -term=TERM set terminal type to TERM" -," -tlog toggles use of a Lynx Trace Log for the current session" -," -trace turns on Lynx trace mode" -," -traversal traverse all http links derived from startfile" -," -underscore toggles use of _underline_ format in dumps" -," -useragent=Name set alternate Lynx User-Agent header" -#if defined(NCURSES_MOUSE_VERSION) || defined(USE_SLANG_MOUSE) -," -use_mouse enable use of the mouse" -#endif -," -validate accept only http URLs (for validation)" -," -version print Lynx version information" -," -vikeys enable vi-like key movement" -," -width=NUMBER screen width for formatting of dumps (default is 80)" - }; - size_t n; - for (n = 0; n < sizeof(Options)/sizeof(Options[0]); n++) - printf("%s\n", Options[n]); - } - if (strncmp(argv[0], "-help", 5) != 0) - exit(-1); - exit(0); - break; + if (pgm == 0) pgm = "LYNX"; - } /* end of switch. */ + fprintf (stderr, "%s: Invalid Option: %s\n", pgm, argv[0]); + print_help_and_exit (-1); } #ifndef VMS diff --git a/src/LYMainLoop.c b/src/LYMainLoop.c index 8f9c976e..51bbb262 100644 --- a/src/LYMainLoop.c +++ b/src/LYMainLoop.c @@ -3188,7 +3188,7 @@ new_cmd: /* HTUnEscapeSome(user_input_buffer, " \r\n\t"); convert_to_spaces(user_input_buffer, TRUE); } else { - collapse_spaces(user_input_buffer); + LYRemoveBlanks(user_input_buffer); } if (user_input_buffer[0] != '\0') { goto check_goto_URL; @@ -3275,7 +3275,7 @@ new_cmd: /* HTUnEscapeSome(user_input_buffer, " \r\n\t"); convert_to_spaces(user_input_buffer, TRUE); } else { - collapse_spaces(user_input_buffer); + LYRemoveBlanks(user_input_buffer); } if (user_input_buffer[0] != '\0') { goto check_goto_URL; @@ -3350,7 +3350,7 @@ check_recall: HTUnEscapeSome(user_input_buffer, " \r\n\t"); convert_to_spaces(user_input_buffer, TRUE); } else { - collapse_spaces(user_input_buffer); + LYRemoveBlanks(user_input_buffer); } if (*user_input_buffer == '\0' && !(recall && (ch == UPARROW || ch == DNARROW))) { @@ -5452,7 +5452,7 @@ check_add_bookmark_to_self: HTUnEscapeSome(ret, " \r\n\t"); convert_to_spaces(ret, TRUE); } else { - collapse_spaces(user_input_buffer); + LYRemoveBlanks(user_input_buffer); } StrAllocCopy(newdoc.address, ret); StrAllocCopy(lynxjumpfile, ret); diff --git a/src/LYNews.c b/src/LYNews.c index 5574819c..6df6a9ff 100644 --- a/src/LYNews.c +++ b/src/LYNews.c @@ -152,9 +152,7 @@ PUBLIC char *LYNewsPost ARGS2( /* * Add the default subject. */ - while (isspace(*cp)) { - cp++; - } + cp = LYSkipBlanks(cp); if (strncasecomp(cp, "Re:", 3)) { strcat(user_input, "Re: "); } diff --git a/src/LYOptions.c b/src/LYOptions.c index 0bd7bb0f..b218ee25 100644 --- a/src/LYOptions.c +++ b/src/LYOptions.c @@ -524,12 +524,8 @@ draw_options: * Set the new DISPLAY variable. - FM */ #ifdef VMS - { - int i; - for (i = 0; display_option[i]; i++) - display_option[i] = TOUPPER(display_option[i]); - Define_VMSLogical(DISPLAY, display_option); - } + LYUpperCase(display_option); + Define_VMSLogical(DISPLAY, display_option); #else sprintf(putenv_command, "DISPLAY=%s", display_option); putenv(putenv_command); @@ -875,7 +871,7 @@ draw_options: } break; - case 'c': /* Change charset setting. */ + case 'c': /* Change display charset setting. */ case 'C': if (!LYSelectPopups) { current_char_set = boolean_choice(current_char_set, diff --git a/src/LYPrint.c b/src/LYPrint.c index ee40408e..72d7e322 100644 --- a/src/LYPrint.c +++ b/src/LYPrint.c @@ -132,7 +132,7 @@ PUBLIC int printfile ARGS1( */ if (HText_getContentBase()) { StrAllocCopy(content_base, HText_getContentBase()); - collapse_spaces(content_base); + LYRemoveBlanks(content_base); if (!(content_base && *content_base)) { FREE(content_base); } @@ -144,7 +144,7 @@ PUBLIC int printfile ARGS1( if (HTisDocumentSource()) { if (HText_getContentLocation()) { StrAllocCopy(content_location, HText_getContentLocation()); - collapse_spaces(content_location); + LYRemoveBlanks(content_location); if (!(content_location && *content_location)) { FREE(content_location); } @@ -164,7 +164,7 @@ PUBLIC int printfile ARGS1( /* * Load the suggested filename string. - FM */ - if (HText_getSugFname() != NULL) + if (HText_getSugFname() != 0) StrAllocCopy(sug_filename, HText_getSugFname()); /* must be freed */ else StrAllocCopy(sug_filename, newdoc->address); /* must be freed */ diff --git a/src/LYReadCFG.c b/src/LYReadCFG.c index 11b85edc..be9acfa6 100644 --- a/src/LYReadCFG.c +++ b/src/LYReadCFG.c @@ -437,884 +437,682 @@ PRIVATE void parse_color ARGS1( } #endif /* USE_COLOR_TABLE */ -/* - * Process the configuration file (lynx.cfg). - */ -PUBLIC void read_cfg ARGS3( - char *, cfg_filename, - char *, parent_filename, - int, nesting_level) +#define MAX_LINE_BUFFER_LEN 501 + +typedef int (*ParseFunc) PARAMS((char *)); + +typedef union { + lynx_html_item_type ** add_value; + BOOLEAN * set_value; + int * int_value; + char ** str_value; + ParseFunc fun_value; + long def_value; +} ConfigUnion; + +#undef PARSE_DEBUG +#ifdef PARSE_DEBUG +#define ParseData \ + lynx_html_item_type** add_value; \ + BOOLEAN *set_value; \ + int *int_value; \ + char **str_value; \ + ParseFunc fun_value; \ + long def_value +#define PARSE_ADD(n,t,v) {n,t, &v, 0, 0, 0, 0, 0} +#define PARSE_SET(n,t,v) {n,t, 0, &v, 0, 0, 0, 0} +#define PARSE_INT(n,t,v) {n,t, 0, 0, &v, 0, 0, 0} +#define PARSE_STR(n,t,v) {n,t, 0, 0, 0, &v, 0, 0} +#define PARSE_FUN(n,t,v) {n,t, 0, 0, 0, 0, v, 0} +#define PARSE_DEF(n,t,v) {n,t, 0, 0, 0, 0, 0, v} +#else +#define ParseData long value +#define PARSE_ADD(n,t,v) {n,t, (long)&(v)} +#define PARSE_SET(n,t,v) {n,t, (long)&(v)} +#define PARSE_INT(n,t,v) {n,t, (long)&(v)} +#define PARSE_STR(n,t,v) {n,t, (long)&(v)} +#define PARSE_FUN(n,t,v) {n,t, (long) (v)} +#define PARSE_DEF(n,t,v) {n,t, (long) (v)} +#endif + +typedef struct { - FILE *fp; - char buffer[501]; - char temp[501]; - char *cp, *cp1; - int i, j, len; + char *name; + int type; +#define CONF_BOOL 1 /* BOOLEAN type */ +#define CONF_FUN 2 +#define CONF_INT 3 +#define CONF_STR 4 +#define CONF_ENV 5 /* from environment variable */ +#define CONF_INCLUDE 6 /* include file-- handle special */ +#define CONF_ADD_ITEM 7 +#define CONF_ADD_TRUSTED 8 + + ParseData; +} +Config_Type; - CTRACE(tfp, "Loading cfg file '%s'.\n", cfg_filename); +static int assume_charset_fun ARGS1( + char *, value) +{ + StrAllocCopy(UCAssume_MIMEcharset, value); + LYLowerCase(UCAssume_MIMEcharset); + UCLYhndl_for_unspec = UCGetLYhndl_byMIME(UCAssume_MIMEcharset); + return 0; +} - /* - * Don't get hung up by an include file loop. Arbitrary max depth - * of 10. - BL - */ - if (nesting_level > 10) { - fprintf(stderr, - "More than %d nested lynx.cfg includes -- perhaps there is a loop?!?\n", - nesting_level - 1); - fprintf(stderr,"Last attempted include was '%s',\n", cfg_filename); - fprintf(stderr,"included from '%s'.\n", parent_filename); - exit(-1); - } - /* - * Locate and open the file. - */ - if (!cfg_filename || strlen(cfg_filename) == 0) { - CTRACE(tfp,"No filename following -cfg switch!\n"); - return; - } - if ((fp = fopen(cfg_filename,"r")) == NULL) { - CTRACE(tfp,"lynx.cfg file not found as %s\n",cfg_filename); - return; - } - have_read_cfg=TRUE; +static int assume_local_charset_fun ARGS1( + char *, value) +{ + StrAllocCopy(UCAssume_localMIMEcharset, value); + LYLowerCase(UCAssume_localMIMEcharset); + UCLYhndl_HTFile_for_unspec = UCGetLYhndl_byMIME(UCAssume_localMIMEcharset); + return 0; +} - /* - * Process each line in the file. - */ - while (fgets(buffer, 500, fp) != NULL) { - /* - * Strip off \n at the end. - */ - if ((cp = (char *)strchr(buffer, '\n')) != NULL) - *cp = '\0'; +static int assume_unrec_charset_fun ARGS1( + char *, value) +{ + StrAllocCopy(UCAssume_unrecMIMEcharset, value); + LYLowerCase(UCAssume_unrecMIMEcharset); + UCLYhndl_for_unrec = UCGetLYhndl_byMIME(UCAssume_unrecMIMEcharset); + return 0; +} - /* - * Trim off any trailing comments. - */ - if ((cp = (char *)strrchr(buffer, ':')) != NULL) { - if ((cp1 = (char *)strchr(cp, '#')) != NULL) { - cp1--; - if (isspace((unsigned char)*cp1)) { - *cp1 = '\0'; - } - } +static int character_set_fun ARGS1( + char *, value) +{ + size_t i; + size_t len; + + len = strlen (value); + for (i = 0; LYchar_set_names[i]; i++) { + if (!strncmp(value, LYchar_set_names[i], len)) { + current_char_set = i; + HTMLSetRawModeDefault(i); + break; } + } - /* - * Strip off trailing white space. - */ - len = strlen(buffer); - while (len && isspace(buffer[len-1])) { - len--; - buffer[len] = '\0'; - } + return 0; +} - /* - * Skip any blank or purely comment lines. - */ - if (buffer[0] == '\0' || buffer[0] == '#') - continue; +#ifdef USE_COLOR_TABLE +static int color_fun ARGS1( + char *, value) +{ + parse_color (value); + return 0; +} +#endif - /* - * Process the string buffer. - */ - switch (TOUPPER(buffer[0])) { - - case 'A': - if (!strncasecomp(buffer, "ALERTSECS:", 10)) { - strcpy(temp, buffer+10); - for (i = 0; temp[i]; i++) { - if (!isdigit(temp[i])) { - temp[i] = '\0'; - break; - } - } - if (temp[0]) - AlertSecs = atoi(temp); +static int default_bookmark_file_fun ARGS1( + char *, value) +{ + StrAllocCopy(bookmark_page, value); + StrAllocCopy(BookmarkPage, bookmark_page); + StrAllocCopy(MBM_A_subbookmark[0], bookmark_page); + StrAllocCopy(MBM_A_subdescript[0], MULTIBOOKMARKS_DEFAULT); + return 0; +} - } else if (!strncasecomp(buffer, "ALWAYS_RESUBMIT_POSTS:", 22)) { - LYresubmit_posts = is_true(buffer+22); +static int default_cache_size_fun ARGS1( + char *, value) +{ + HTCacheSize = atoi(value); + if (HTCacheSize < 2) HTCacheSize = 2; + return 0; +} -#ifdef EXEC_LINKS - } else if (!strncasecomp(buffer, "ALWAYS_TRUSTED_EXEC:", 20)) { - add_trusted(&buffer[20], ALWAYS_EXEC_PATH); /* Add exec path */ -#endif /* EXEC_LINKS */ - - } else if (!strncasecomp(buffer, "ASSUME_CHARSET:", 15)) { - StrAllocCopy(UCAssume_MIMEcharset, buffer+15); - for (i = 0; UCAssume_MIMEcharset[i]; i++) - UCAssume_MIMEcharset[i] = TOLOWER(UCAssume_MIMEcharset[i]); - UCLYhndl_for_unspec = - UCGetLYhndl_byMIME(UCAssume_MIMEcharset); - - } else if (!strncasecomp(buffer, "ASSUME_LOCAL_CHARSET:", 21)) { - StrAllocCopy(UCAssume_localMIMEcharset, buffer+21); - for (i = 0; UCAssume_localMIMEcharset[i]; i++) - UCAssume_localMIMEcharset[i] = - TOLOWER(UCAssume_localMIMEcharset[i]); - UCLYhndl_HTFile_for_unspec = - UCGetLYhndl_byMIME(UCAssume_localMIMEcharset); - - } else if (!strncasecomp(buffer, "ASSUME_UNREC_CHARSET:", 21)) { - StrAllocCopy(UCAssume_unrecMIMEcharset, buffer+21); - for (i = 0; UCAssume_unrecMIMEcharset[i]; i++) - UCAssume_unrecMIMEcharset[i] = - TOLOWER(UCAssume_unrecMIMEcharset[i]); - UCLYhndl_for_unrec = - UCGetLYhndl_byMIME(UCAssume_unrecMIMEcharset); - } - break; +static int default_editor_fun ARGS1( + char *, value) +{ + if (!system_editor) StrAllocCopy(editor, value); + return 0; +} - case 'B': - if (!strncasecomp(buffer, "BLOCK_MULTI_BOOKMARKS:", 22)) { - LYMBMBlocked = is_true(buffer+22); +static int numbers_as_arrows_fun ARGS1( + char *, value) +{ + if (is_true(value)) + keypad_mode = NUMBERS_AS_ARROWS; + else + keypad_mode = LINKS_ARE_NUMBERED; - } else if (!strncasecomp(buffer, "BOLD_H1:", 8)) { - bold_H1 = is_true(buffer+8); + return 0; +} - } else if (!strncasecomp(buffer, "BOLD_HEADERS:", 13)) { - bold_headers = is_true(buffer+13); +static int default_user_mode_fun ARGS1( + char *, value) +{ + if (!strncasecomp(value, "NOVICE", 6)) + user_mode = NOVICE_MODE; + else if (!strncasecomp(value, "INTER", 5)) + user_mode = INTERMEDIATE_MODE; + else if (!strncasecomp(value, "ADVANCE", 7)) + user_mode = ADVANCED_MODE; + + return 0; +} - } else if (!strncasecomp(buffer, "BOLD_NAME_ANCHORS:", 18)) { - bold_name_anchors = is_true(buffer+18); - } - break; - - case 'C': - if (!strncasecomp(buffer, "CASE_SENSITIVE_ALWAYS_ON:", 25)) { - case_sensitive = is_true(buffer+25); - - } else if (!strncasecomp(buffer, "CHARACTER_SET:", 14)) { - for (i = 0; LYchar_set_names[i]; i++) { - if (!strncmp(buffer+14, - LYchar_set_names[i], strlen(buffer+14))) { - current_char_set=i; - HTMLSetRawModeDefault(i); - break; - } - } +#ifdef DIRED_SUPPORT +static int dired_menu_fun ARGS1( + char *, value) +{ + add_menu_item(value); + return 0; +} +#endif - } else if (!strncasecomp(buffer, "CHECKMAIL:", 10)) { - check_mail = is_true(buffer+10); +static int jumpfile_fun ARGS1( + char *, value) +{ + char buffer [MAX_LINE_BUFFER_LEN]; - } else if (!strncasecomp(buffer, "COLLAPSE_BR_TAGS:", 17)) { - LYCollapseBRs = is_true(buffer+17); + sprintf (buffer, "JUMPFILE:%s", value); + if (!LYJumpInit(buffer)) + CTRACE(tfp, "Failed to register %s\n", buffer); -#if USE_COLOR_TABLE - } else if (!strncasecomp(buffer, "COLOR:", 6)) { - parse_color(buffer + 6); -#endif /* USE_COLOR_TABLE */ + return 0; +} - } else if (!strncasecomp(buffer, "cso_proxy:", 10)) { - if (getenv("cso_proxy") == NULL) { -#ifdef VMS - strcpy(temp, "cso_proxy"); - Define_VMSLogical(temp, (char *)&buffer[10]); -#else - strcpy(temp, "cso_proxy="); - StrAllocCopy(cso_proxy_putenv_cmd, temp); - StrAllocCat(cso_proxy_putenv_cmd, (char *)&buffer[10]); - putenv(cso_proxy_putenv_cmd); -#endif /* VMS */ - } +static int keymap_fun ARGS1( + char *, key) +{ + char *func; + + if ((func = strchr(key, ':')) != NULL) { + *func++ = '\0'; + /* Allow comments on the ends of key remapping lines. - DT */ + if (!remap(key, strtok(func, " \t\n#"))) + fprintf(stderr, + "key remapping of %s to %s failed\n",key,func); + else if (!strcmp("TOGGLE_HELP", strtok(func, " \t\n#"))) + LYUseNoviceLineTwo = FALSE; + } + return 0; +} -#ifdef VMS - } else if (!strncasecomp(buffer, "CSWING_PATH:", 12)) { - StrAllocCopy(LYCSwingPath, buffer+12); -#endif /* VMS */ - } - break; - - case 'D': - if (!strncasecomp(buffer, "DEFAULT_BOOKMARK_FILE:", 22)) { - StrAllocCopy(bookmark_page, buffer+22); - StrAllocCopy(BookmarkPage, bookmark_page); - StrAllocCopy(MBM_A_subbookmark[0], bookmark_page); - StrAllocCopy(MBM_A_subdescript[0], MULTIBOOKMARKS_DEFAULT); - - } else if (!strncasecomp(buffer, "DEFAULT_CACHE_SIZE:", 19)) { - HTCacheSize = atoi(buffer+19); - if (HTCacheSize < 2) HTCacheSize = 2; - - } else if (!system_editor && - !strncasecomp(buffer, "DEFAULT_EDITOR:", 15)) { - StrAllocCopy(editor, buffer+15); - - } else if (!strncasecomp(buffer, "DEFAULT_INDEX_FILE:", 19)) { - StrAllocCopy(indexfile, buffer+19); - - } else if (!strncasecomp(buffer, - "DEFAULT_KEYPAD_MODE_IS_NUMBERS_AS_ARROWS:", 41)) { - if (is_true(buffer+41)) - keypad_mode = NUMBERS_AS_ARROWS; - else - keypad_mode = LINKS_ARE_NUMBERED; - - } else if (!strncasecomp(buffer, "DEFAULT_USER_MODE:", 18)) { - if (!strncasecomp(buffer+18, "NOVICE", 6)) - user_mode = NOVICE_MODE; - else if (!strncasecomp(buffer+18, "INTER", 5)) - user_mode = INTERMEDIATE_MODE; - else if (!strncasecomp(buffer+18, "ADVANCE", 7)) - user_mode = ADVANCED_MODE; +static int localhost_alias_fun ARGS1( + char *, value) +{ + LYAddLocalhostAlias(value); + return 0; +} -#if defined(VMS) && defined(VAXC) && !defined(__DECC) - } else if (!strncasecomp(buffer, - "DEFAULT_VIRTUAL_MEMORY_SIZE:", 28)) { - HTVirtualMemorySize = atoi(buffer+28); -#endif /* VMS && VAXC && !__DECC */ +#ifdef LYNXCGI_LINKS +static int lynxcgi_environment_fun ARGS1( + char *, value) +{ + add_lynxcgi_environment(value); + return 0; +} +#endif -#ifdef DIRED_SUPPORT - } else if (!strncasecomp(buffer, "DIRED_MENU:", 11)) { - add_menu_item(&buffer[11]); -#endif /* DIRED_SUPPORT */ +static int lynx_sig_file_fun ARGS1( + char *, value) +{ + if (LYPathOffHomeOK(value, 256)) { + StrAllocCopy(LynxSigFile, value); + LYAddPathToHome(value, 256, LynxSigFile); + StrAllocCopy(LynxSigFile, value); + CTRACE(tfp, "LYNX_SIG_FILE set to '%s'\n", LynxSigFile); + } else { + CTRACE(tfp, "LYNX_SIG_FILE '%s' is bad. Ignoring.\n", LYNX_SIG_FILE); + } + return 0; +} - } else if (!strncasecomp(buffer, "DOWNLOADER:", 11)) { - add_item_to_list(&buffer[11], &downloaders); - } - break; +static int news_chunk_size_fun ARGS1( + char *, value) +{ + HTNewsChunkSize = atoi(value); + /* + * If the new HTNewsChunkSize exceeds the maximum, + * increase HTNewsMaxChunk to this size. - FM + */ + if (HTNewsChunkSize > HTNewsMaxChunk) + HTNewsMaxChunk = HTNewsChunkSize; + return 0; +} - case 'E': - if (!strncasecomp(buffer, "EMACS_KEYS_ALWAYS_ON:", 21)) { - emacs_keys = is_true(buffer+21); +static int news_max_chunk_fun ARGS1( + char *, value) +{ + HTNewsMaxChunk = atoi(value); + /* + * If HTNewsChunkSize exceeds the new maximum, + * reduce HTNewsChunkSize to this maximum. - FM + */ + if (HTNewsChunkSize > HTNewsMaxChunk) + HTNewsChunkSize = HTNewsMaxChunk; + return 0; +} - } else if (!strncasecomp(buffer, "ENABLE_SCROLLBACK:", 18)) { - enable_scrollback = is_true(buffer+18); - } -#ifdef USE_EXTERNALS - else if(!strncasecomp(buffer,"EXTERNAL:",9)) { - add_item_to_list(&buffer[9],&externals); - } -#endif - break; +static int news_posting_fun ARGS1( + char *, value) +{ + LYNewsPosting = is_true(value); + no_newspost = (LYNewsPosting == FALSE); + return 0; +} - case 'F': - if (!strncasecomp(buffer, "finger_proxy:", 13)) { - if (getenv("finger_proxy") == NULL) { -#ifdef VMS - strcpy(temp, "finger_proxy"); - Define_VMSLogical(temp, (char *)&buffer[13]); -#else - strcpy(temp, "finger_proxy="); - StrAllocCopy(finger_proxy_putenv_cmd, temp); - StrAllocCat(finger_proxy_putenv_cmd, (char *)&buffer[13]); - putenv(finger_proxy_putenv_cmd); -#endif /* VMS */ - } +static int printer_fun ARGS1( + char *, value) +{ + add_printer_to_list(value, &printers); + return 0; +} - } else if (!strncasecomp(buffer, "FORCE_SSL_COOKIES_SECURE:", 25)) { - LYForceSSLCookiesSecure = is_true(buffer+25); +static int suffix_fun ARGS1( + char *, value) +{ + char *mime_type; - } else if (!strncasecomp(buffer, "ftp_proxy:", 10)) { - if (getenv("ftp_proxy") == NULL) { -#ifdef VMS - strcpy(temp, "ftp_proxy"); - Define_VMSLogical(temp, (char *)&buffer[10]); -#else - strcpy(temp, "ftp_proxy="); - StrAllocCopy(ftp_proxy_putenv_cmd, temp); - StrAllocCat(ftp_proxy_putenv_cmd, (char *)&buffer[10]); - putenv(ftp_proxy_putenv_cmd); -#endif /* VMS */ - } - } - break; + if ((strlen (value) < 3) + || (NULL == (mime_type = strchr (value, ':')))) + return 0; - case 'G': - if (!strncasecomp(buffer, "GLOBAL_EXTENSION_MAP:", 21)) { - StrAllocCopy(global_extension_map, buffer+21); + *mime_type++ = '\0'; - } else if (!strncasecomp(buffer, "GLOBAL_MAILCAP:", 15)) { - StrAllocCopy(global_type_map, buffer+15); + LYRemoveBlanks(mime_type); + LYLowerCase(mime_type); - } else if (!strncasecomp(buffer, "gopher_proxy:", 13)) { - if (getenv("gopher_proxy") == NULL) { -#ifdef VMS - strcpy(temp, "gopher_proxy"); - Define_VMSLogical(temp, (char *)&buffer[13]); -#else - strcpy(temp, "gopher_proxy="); - StrAllocCopy(gopher_proxy_putenv_cmd, temp); - StrAllocCat(gopher_proxy_putenv_cmd, (char *)&buffer[13]); - putenv(gopher_proxy_putenv_cmd); -#endif /* VMS */ - } + if (strstr(mime_type, "tex") != NULL || + strstr(mime_type, "postscript") != NULL || + strstr(mime_type, "sh") != NULL || + strstr(mime_type, "troff") != NULL || + strstr(mime_type, "rtf") != NULL) + HTSetSuffix(value, mime_type, "8bit", 1.0); + else + HTSetSuffix(value, mime_type, "binary", 1.0); - } else if (!strncasecomp(buffer, "GOTOBUFFER:", 11)) { - goto_buffer = is_true(buffer+11); - } - break; + return 0; +} - case 'H': - if (!strncasecomp(buffer, "HELPFILE:", 9)) { - StrAllocCopy(helpfile, buffer+9); +static int system_editor_fun ARGS1( + char *, value) +{ + StrAllocCopy(editor, value); + system_editor = TRUE; + return 0; +} - } else if (!strncasecomp(buffer, "HISTORICAL_COMMENTS:", 20)) { - historical_comments = is_true(buffer+20); +static int viewer_fun ARGS1( + char *, value) +{ + char *mime_type; + char *viewer; + char *environment; + char *cp; - } else if (!strncasecomp(buffer, "http_proxy:", 11)) { - if (getenv("http_proxy") == NULL) { -#ifdef VMS - strcpy(temp, "http_proxy"); - Define_VMSLogical(temp, (char *)&buffer[11]); -#else - strcpy(temp, "http_proxy="); - StrAllocCopy(http_proxy_putenv_cmd, temp); - StrAllocCat(http_proxy_putenv_cmd, (char *)&buffer[11]); - putenv(http_proxy_putenv_cmd); -#endif /* VMS */ - } + mime_type = value; - } else if (!strncasecomp(buffer, "https_proxy:", 12)) { - if (getenv("https_proxy") == NULL) { -#ifdef VMS - strcpy(temp, "https_proxy"); - Define_VMSLogical(temp, (char *)&buffer[12]); -#else - strcpy(temp, "https_proxy="); - StrAllocCopy(https_proxy_putenv_cmd, temp); - StrAllocCat(https_proxy_putenv_cmd, (char *)&buffer[12]); - putenv(https_proxy_putenv_cmd); -#endif /* VMS */ - } - } - break; - - case 'I': - if (!strncasecomp(buffer, "include:", 8)) { - strcpy(temp, buffer+8); - read_cfg(temp, cfg_filename, nesting_level + 1); - } else if (!strncasecomp(buffer, "INFOSECS:", 9)) { - strcpy(temp, buffer+9); - for (i = 0; temp[i]; i++) { - if (!isdigit(temp[i])) { - temp[i] = '\0'; - break; - } - } - if (temp[0]) - InfoSecs = atoi(temp); - } - break; + if ((strlen (value) < 3) + || (NULL == (viewer = strchr (mime_type, ':')))) + return 0; - case 'J': - if (!strncasecomp(buffer, "JUMP_PROMPT:", 12)) { - StrAllocCopy(jumpprompt, buffer+12); + *viewer++ = '\0'; - } else if (!strncasecomp(buffer, "JUMPBUFFER:", 11)) { - jump_buffer = is_true(buffer+11); + LYRemoveBlanks(mime_type); + LYLowerCase(mime_type); - } else if (!strncasecomp(buffer, "JUMPFILE:", 9)) { - if (!LYJumpInit(buffer)) { - CTRACE(tfp, "Failed to register %s\n", buffer); - } - } - break; - - case 'K': - if (!strncasecomp(buffer, "KEYMAP:", 7)) { - char *key; - char *func; - - key = buffer + 7; - if ((func = strchr(key, ':')) != NULL) { - *func++ = '\0'; - /* Allow comments on the ends of key remapping lines. - DT */ - if (!remap(key, strtok(func, " \t\n#"))) - fprintf(stderr, - "key remapping of %s to %s failed\n",key,func); - else if (!strcmp("TOGGLE_HELP", strtok(func, " \t\n#"))) - LYUseNoviceLineTwo = FALSE; - } + environment = strrchr(viewer, ':'); + if ((environment != NULL) && + (strlen(viewer) > 1) && *(environment-1) != '\\') { + *environment++ = '\0'; + remove_backslashes(viewer); + /* + * If environment equals xwindows then only assign the presentation if + * there is a $DISPLAY variable. + */ + if (!strcasecomp(environment,"XWINDOWS")) { + if ((cp = getenv(DISPLAY)) != NULL && *cp != '\0') + HTSetPresentation(mime_type, viewer, 1.0, 3.0, 0.0, 0); + } else if (!strcasecomp(environment,"NON_XWINDOWS")) { + if ((cp = getenv(DISPLAY)) == NULL || *cp == '\0') + HTSetPresentation(mime_type, viewer, 1.0, 3.0, 0.0, 0); + } else { + HTSetPresentation(mime_type, viewer, 1.0, 3.0, 0.0, 0); } - break; - - case 'L': - if (!strncasecomp(buffer, "LIST_NEWS_NUMBERS:", 18)) { - LYListNewsNumbers = is_true(buffer+18); + } else { + remove_backslashes(viewer); + HTSetPresentation(mime_type, viewer, 1.0, 3.0, 0.0, 0); + } - } else if (!strncasecomp(buffer, "LIST_NEWS_DATES:", 16)) { - LYListNewsDates = is_true(buffer+16); + return 0; +} +static Config_Type Config_Table [] = +{ + PARSE_INT("alertsecs", CONF_INT, AlertSecs), + PARSE_SET("always_resubmit_posts", CONF_BOOL, LYresubmit_posts), +#ifdef EXEC_LINKS + PARSE_DEF("always_trusted_exec", CONF_ADD_TRUSTED, ALWAYS_EXEC_PATH), +#endif + PARSE_FUN("assume_charset", CONF_FUN, assume_charset_fun), + PARSE_FUN("assume_local_charset", CONF_FUN, assume_local_charset_fun), + PARSE_FUN("assume_unrec_charset", CONF_FUN, assume_unrec_charset_fun), + PARSE_SET("block_multi_bookmarks", CONF_BOOL, LYMBMBlocked), + PARSE_SET("bold_h1", CONF_BOOL, bold_H1), + PARSE_SET("bold_headers", CONF_BOOL, bold_headers), + PARSE_SET("bold_name_anchors", CONF_BOOL, bold_name_anchors), + PARSE_SET("case_sensitive_always_on", CONF_BOOL, case_sensitive), + PARSE_FUN("character_set", CONF_FUN, character_set_fun), + PARSE_SET("checkmail", CONF_BOOL, check_mail), + PARSE_SET("collapse_br_tags", CONF_BOOL, LYCollapseBRs), +#ifdef USE_COLOR_TABLE + PARSE_FUN("color", CONF_FUN, color_fun), +#endif + PARSE_STR("cso_proxy", CONF_ENV, cso_proxy_putenv_cmd ), +#ifdef VMS + PARSE_STR("CSWING_PATH", CONF_STR, LYCSwingPath), +#endif + PARSE_FUN("default_bookmark_file", CONF_FUN, default_bookmark_file_fun), + PARSE_FUN("default_cache_size", CONF_FUN, default_cache_size_fun), + PARSE_FUN("default_editor", CONF_FUN, default_editor_fun), + PARSE_STR("default_index_file", CONF_STR, indexfile), + PARSE_FUN("default_keypad_mode_is_numbers_as_arrows", CONF_FUN, numbers_as_arrows_fun), + PARSE_FUN("default_user_mode", CONF_FUN, default_user_mode_fun), +#if defined(VMS) && defined(VAXC) && !defined(__DECC) + PARSE_INT("default_virtual_memory_size", CONF_INT, HTVirtualMemorySize), +#endif +#ifdef DIRED_SUPPORT + PARSE_FUN("dired_menu", CONF_FUN, dired_menu_fun), +#endif + PARSE_ADD("downloader", CONF_ADD_ITEM, downloaders), + PARSE_SET("emacs_keys_always_on", CONF_BOOL, emacs_keys), + PARSE_SET("enable_scrollback", CONF_BOOL, enable_scrollback), +#ifdef USE_EXTERNALS + PARSE_ADD("external", CONF_ADD_ITEM, externals), +#endif + PARSE_STR("finger_proxy", CONF_ENV, finger_proxy_putenv_cmd ), + PARSE_SET("force_ssl_cookies_secure", CONF_BOOL, LYForceSSLCookiesSecure), + PARSE_STR("ftp_proxy", CONF_ENV, ftp_proxy_putenv_cmd ), + PARSE_STR("global_extension_map", CONF_STR, global_extension_map), + PARSE_STR("global_mailcap", CONF_STR, global_type_map), + PARSE_STR("gopher_proxy", CONF_ENV, gopher_proxy_putenv_cmd ), + PARSE_SET("gotobuffer", CONF_BOOL, goto_buffer), + PARSE_STR("helpfile", CONF_STR, helpfile), + PARSE_SET("historical_comments", CONF_BOOL, historical_comments), + PARSE_STR("http_proxy", CONF_ENV, http_proxy_putenv_cmd ), + PARSE_STR("https_proxy", CONF_ENV, https_proxy_putenv_cmd ), + PARSE_FUN("include", CONF_INCLUDE, 0), + PARSE_INT("infosecs", CONF_INT, InfoSecs), + PARSE_STR("jump_prompt", CONF_STR, jumpprompt), + PARSE_SET("jumpbuffer", CONF_BOOL, jump_buffer), + PARSE_FUN("jumpfile", CONF_FUN, jumpfile_fun), + PARSE_FUN("keymap", CONF_FUN, keymap_fun), + PARSE_SET("list_news_numbers", CONF_BOOL, LYListNewsNumbers), + PARSE_SET("list_news_dates", CONF_BOOL, LYListNewsDates), #ifndef VMS - } else if (!strncasecomp(buffer, "LIST_FORMAT:", 12)) { - StrAllocCopy(list_format, buffer+12); -#endif /* !VMS */ - - } else if (!strncasecomp(buffer, "LOCALHOST_ALIAS:", 16)) { - LYAddLocalhostAlias(buffer+16); - - } else if (!strncasecomp(buffer, "LOCAL_DOMAIN:", 13)) { - StrAllocCopy(LYLocalDomain, buffer+13); - + PARSE_STR("list_format", CONF_STR, list_format), +#endif + PARSE_FUN("localhost_alias", CONF_FUN, localhost_alias_fun), + PARSE_STR("local_domain", CONF_STR, LYLocalDomain), #if defined(EXEC_LINKS) || defined(EXEC_SCRIPTS) - } else if (!strncasecomp(buffer, - "LOCAL_EXECUTION_LINKS_ALWAYS_ON:", 32)) { - local_exec = is_true(buffer+32); - - } else if (!strncasecomp(buffer, - "LOCAL_EXECUTION_LINKS_ON_BUT_NOT_REMOTE:", 40)) { - local_exec_on_local_files = is_true(buffer+40); -#endif /* defined(EXEC_LINKS) || defined(EXEC_SCRIPTS) */ - + PARSE_SET("local_execution_links_always_on", CONF_BOOL, local_exec), + PARSE_SET("local_execution_links_on_but_not_remote", CONF_BOOL, local_exec_on_local_files), +#endif #ifdef LYNXCGI_LINKS - } else if (!strncasecomp(buffer, "LYNXCGI_ENVIRONMENT:", 20)) { - add_lynxcgi_environment(buffer+20); - + PARSE_FUN("lynxcgi_environment", CONF_FUN, lynxcgi_environment_fun), #ifndef VMS - /* WebSter Mods - Next 2 Lines -jkt */ - } else if (!strncasecomp(buffer, "LYNXCGI_DOCUMENT_ROOT:", 22)) { - StrAllocCopy(LYCgiDocumentRoot, buffer+22); -#endif /* !VMS */ -#endif /* LYNXCGI_LINKS */ - - } else if (!strncasecomp(buffer, "LYNX_HOST_NAME:", 15)) { - StrAllocCopy(LYHostName, buffer+15); - - } else if (!strncasecomp(buffer, "LYNX_SIG_FILE:", 14)) { - strcpy(temp, (buffer+14)); - if (LYPathOffHomeOK(temp, 256)) { - StrAllocCopy(LynxSigFile, temp); - LYAddPathToHome(temp, 256, LynxSigFile); - StrAllocCopy(LynxSigFile, temp); - CTRACE(tfp, "LYNX_SIG_FILE set to '%s'\n", LynxSigFile); - } else { - CTRACE(tfp, "LYNX_SIG_FILE '%s' is bad. Ignoring.\n", - LYNX_SIG_FILE); - } - } - break; - - case 'M': - if (!strncasecomp(buffer, "MAIL_SYSTEM_ERROR_LOGGING:", 26)) { - error_logging = is_true(buffer+26); - + PARSE_STR("lynxcgi_document_root", CONF_STR, LYCgiDocumentRoot), +#endif +#endif + PARSE_STR("lynx_host_name", CONF_STR, LYHostName), + PARSE_FUN("lynx_sig_file", CONF_FUN, lynx_sig_file_fun), + PARSE_SET("mail_system_error_logging", CONF_BOOL, error_logging), #ifdef VMS - } else if (!strncasecomp(buffer, "MAIL_ADRS:", 10)) { - StrAllocCopy(mail_adrs, buffer+10); -#endif /* VMS */ - - } else if (!strncasecomp(buffer, "MAKE_LINKS_FOR_ALL_IMAGES:", 26)) { - clickable_images = is_true(buffer+26); - - } else if (!strncasecomp(buffer, - "MAKE_PSEUDO_ALTS_FOR_INLINES:", 29)) { - pseudo_inline_alts = is_true(buffer+29); - - } else if (!strncasecomp(buffer, "MESSAGESECS:", 12)) { - strcpy(temp, buffer+12); - for (i = 0; temp[i]; i++) { - if (!isdigit(temp[i])) { - temp[i] = '\0'; - break; - } - } - if (temp[0]) - MessageSecs = atoi(temp); - - } else if (!strncasecomp(buffer, "MINIMAL_COMMENTS:", 17)) { - minimal_comments = is_true(buffer+17); - - } else if (!strncasecomp(buffer, "MULTI_BOOKMARK_SUPPORT:", 23)) { - LYMultiBookmarks = is_true(buffer+23); - } - break; - - case 'N': - if (!strncasecomp(buffer, "NEWS_CHUNK_SIZE:", 16)) { - HTNewsChunkSize = atoi(buffer+16); - /* - * If the new HTNewsChunkSize exceeds the maximum, - * increase HTNewsMaxChunk to this size. - FM - */ - if (HTNewsChunkSize > HTNewsMaxChunk) { - HTNewsMaxChunk = HTNewsChunkSize; - } - - } else if (!strncasecomp(buffer, "NEWS_MAX_CHUNK:", 15)) { - HTNewsMaxChunk = atoi(buffer+15); - /* - * If HTNewsChunkSize exceeds the new maximum, - * reduce HTNewsChunkSize to this maximum. - FM - */ - if (HTNewsChunkSize > HTNewsMaxChunk) { - HTNewsChunkSize = HTNewsMaxChunk; - } - - } else if (!strncasecomp(buffer, "NEWS_POSTING:", 13)) { - LYNewsPosting = is_true(buffer+13); - no_newspost = (LYNewsPosting == FALSE); - - } else if (!strncasecomp(buffer, "news_proxy:", 11)) { - if (getenv("news_proxy") == NULL) { + PARSE_STR("mail_adrs", CONF_STR, mail_adrs), +#endif + PARSE_SET("make_links_for_all_images", CONF_BOOL, clickable_images), + PARSE_SET("make_pseudo_alts_for_inlines", CONF_BOOL, pseudo_inline_alts), + PARSE_INT("messagesecs", CONF_INT, MessageSecs), + PARSE_SET("minimal_comments", CONF_BOOL, minimal_comments), + PARSE_INT("multi_bookmark_support", CONF_BOOL, LYMultiBookmarks), + PARSE_FUN("news_chunk_size", CONF_FUN, news_chunk_size_fun), + PARSE_FUN("news_max_chunk", CONF_FUN, news_max_chunk_fun), + PARSE_FUN("news_posting", CONF_FUN, news_posting_fun), + PARSE_STR("news_proxy", CONF_ENV, news_proxy_putenv_cmd), + PARSE_STR("newspost_proxy", CONF_ENV, newspost_proxy_putenv_cmd), + PARSE_STR("newsreply_proxy", CONF_ENV, newsreply_proxy_putenv_cmd), + PARSE_STR("nntp_proxy", CONF_ENV, nntp_proxy_putenv_cmd), + PARSE_STR("nntpserver", CONF_ENV, NNTPSERVER_putenv_cmd), + PARSE_SET("no_dot_files", CONF_BOOL, no_dotfiles), + PARSE_SET("no_file_referer", CONF_BOOL, no_filereferer), +#ifndef VMS + PARSE_SET("no_forced_core_dump", CONF_BOOL, LYNoCore), +#endif + PARSE_SET("no_from_header", CONF_BOOL, LYNoFromHeader), + PARSE_SET("no_ismap_if_usemap", CONF_BOOL, LYNoISMAPifUSEMAP), + PARSE_STR("no_proxy", CONF_ENV, no_proxy_putenv_cmd ), + PARSE_SET("no_referer_header", CONF_BOOL, LYNoRefererHeader), + PARSE_STR("personal_mailcap", CONF_STR, personal_type_map), + PARSE_STR("personal_extension_map", CONF_STR, personal_extension_map), + PARSE_STR("preferred_charset", CONF_STR, pref_charset), + PARSE_STR("preferred_language", CONF_STR, language), + PARSE_SET("prepend_base_to_source", CONF_BOOL, LYPrependBaseToSource), + PARSE_SET("prepend_charset_to_source", CONF_BOOL, LYPrependCharsetToSource), + PARSE_FUN("printer", CONF_FUN, printer_fun), +#ifdef RAWDOSKEYHACK + PARSE_SET("raw_dos_key_hack", CONF_BOOL, raw_dos_key_hack), +#endif + PARSE_SET("quit_default_yes", CONF_BOOL, LYQuitDefaultYes), + PARSE_STR("save_space", CONF_STR, lynx_save_space), + PARSE_SET("scan_for_buried_news_refs", CONF_BOOL, scan_for_buried_news_references), + PARSE_SET("seek_frag_area_in_cur", CONF_BOOL, LYSeekFragAREAinCur), + PARSE_SET("seek_frag_map_in_cur", CONF_BOOL, LYSeekFragMAPinCur), + PARSE_SET("set_cookies", CONF_BOOL, LYSetCookies), + PARSE_SET("show_cursor", CONF_BOOL, LYShowCursor), + PARSE_STR("snews_proxy", CONF_ENV, snews_proxy_putenv_cmd ), + PARSE_STR("snewspost_proxy", CONF_ENV, snewspost_proxy_putenv_cmd ), + PARSE_STR("snewsreply_proxy", CONF_ENV, snewsreply_proxy_putenv_cmd ), + PARSE_SET("soft_dquotes", CONF_BOOL, soft_dquotes), + PARSE_STR("startfile", CONF_STR, startfile), + PARSE_SET("strip_dotdot_urls", CONF_BOOL, LYStripDotDotURLs), + PARSE_SET("substitute_underscores", CONF_BOOL, use_underscore), + PARSE_FUN("suffix", CONF_FUN, suffix_fun), + PARSE_FUN("system_editor", CONF_FUN, system_editor_fun), + PARSE_STR("system_mail", CONF_STR, system_mail), + PARSE_STR("system_mail_flags", CONF_STR, system_mail_flags), +#ifdef EXEC_LINKS + PARSE_DEF("trusted_exec", CONF_ADD_TRUSTED, EXEC_PATH), +#endif +#ifdef LYNXCGI_LINKS + PARSE_DEF("trusted_lynxcgi", CONF_ADD_TRUSTED, CGI_PATH), +#endif + PARSE_STR("url_domain_prefixes", CONF_STR, URLDomainPrefixes), + PARSE_STR("url_domain_suffixes", CONF_STR, URLDomainSuffixes), +#ifdef DIRED_SUPPORT + PARSE_ADD("uploader", CONF_ADD_ITEM, uploaders), +#endif #ifdef VMS - strcpy(temp, "news_proxy"); - Define_VMSLogical(temp, (char *)&buffer[11]); -#else - strcpy(temp, "news_proxy="); - StrAllocCopy(news_proxy_putenv_cmd, temp); - StrAllocCat(news_proxy_putenv_cmd, (char *)&buffer[11]); - putenv(news_proxy_putenv_cmd); -#endif /* VMS */ - } + PARSE_SET("use_fixed_records", CONF_BOOL, UseFixedRecords), +#endif +#if defined(NCURSES_MOUSE_VERSION) || defined(USE_SLANG_MOUSE) + PARSE_SET("use_mouse", CONF_BOOL, LYUseMouse), +#endif + PARSE_SET("use_select_popups", CONF_BOOL, LYSelectPopups), + PARSE_SET("verbose_images", CONF_BOOL, verbose_img), + PARSE_SET("vi_keys_always_on", CONF_BOOL, vi_keys), + PARSE_FUN("viewer", CONF_FUN, viewer_fun), + PARSE_STR("wais_proxy", CONF_ENV, wais_proxy_putenv_cmd ), + PARSE_STR("xloadimage_command", CONF_STR, XLoadImageCommand), + + {0} +}; - } else if (!strncasecomp(buffer, "newspost_proxy:", 15)) { - if (getenv("newspost_proxy") == NULL) { -#ifdef VMS - strcpy(temp, "newspost_proxy"); - Define_VMSLogical(temp, (char *)&buffer[15]); -#else - strcpy(temp, "newspost_proxy="); - StrAllocCopy(newspost_proxy_putenv_cmd, temp); - StrAllocCat(newspost_proxy_putenv_cmd, (char *)&buffer[15]); - putenv(newspost_proxy_putenv_cmd); -#endif /* VMS */ - } +/* + * Process the configuration file (lynx.cfg). + */ +PUBLIC void read_cfg ARGS3( + char *, cfg_filename, + char *, parent_filename, + int, nesting_level) +{ + FILE *fp; + char buffer[MAX_LINE_BUFFER_LEN]; - } else if (!strncasecomp(buffer, "newsreply_proxy:", 16)) { - if (getenv("newsreply_proxy") == NULL) { -#ifdef VMS - strcpy(temp, "newsreply_proxy"); - Define_VMSLogical(temp, (char *)&buffer[16]); -#else - strcpy(temp, "newsreply_proxy="); - StrAllocCopy(newsreply_proxy_putenv_cmd, temp); - StrAllocCat(newsreply_proxy_putenv_cmd, (char *)&buffer[16]); - putenv(newsreply_proxy_putenv_cmd); -#endif /* VMS */ - } + CTRACE(tfp, "Loading cfg file '%s'.\n", cfg_filename); - } else if (!strncasecomp(buffer, "nntp_proxy:", 11)) { - if (getenv("nntp_proxy") == NULL) { -#ifdef VMS - strcpy(temp, "nntp_proxy"); - Define_VMSLogical(temp, (char *)&buffer[11]); -#else - strcpy(temp, "nntp_proxy="); - StrAllocCopy(nntp_proxy_putenv_cmd, temp); - StrAllocCat(nntp_proxy_putenv_cmd, (char *)&buffer[11]); - putenv(nntp_proxy_putenv_cmd); -#endif /* VMS */ - } + /* + * Don't get hung up by an include file loop. Arbitrary max depth + * of 10. - BL + */ + if (nesting_level > 10) { + fprintf(stderr, + "More than %d nested lynx.cfg includes -- perhaps there is a loop?!?\n", + nesting_level - 1); + fprintf(stderr,"Last attempted include was '%s',\n", cfg_filename); + fprintf(stderr,"included from '%s'.\n", parent_filename); + exit(-1); + } + /* + * Locate and open the file. + */ + if (!cfg_filename || strlen(cfg_filename) == 0) { + CTRACE(tfp,"No filename following -cfg switch!\n"); + return; + } + if ((fp = fopen(cfg_filename,"r")) == 0) { + CTRACE(tfp,"lynx.cfg file not found as %s\n",cfg_filename); + return; + } + have_read_cfg = TRUE; - } else if (!strncasecomp(buffer, "NNTPSERVER:", 11)) { - if (getenv("NNTPSERVER") == NULL) { -#ifdef VMS - strcpy(temp, "NNTPSERVER"); - Define_VMSLogical(temp, (char *)&buffer[11]); + /* + * Process each line in the file. + */ + while (fgets(buffer, sizeof(buffer), fp) != 0) { + char *name, *value; + char *cp; + Config_Type *tbl; + char ch; +#ifdef PARSE_DEBUG + Config_Type *q; #else - strcpy(temp, "NNTPSERVER="); - StrAllocCopy(NNTPSERVER_putenv_cmd, temp); - StrAllocCat(NNTPSERVER_putenv_cmd, (char *)&buffer[11]); - putenv(NNTPSERVER_putenv_cmd); -#endif /* VMS */ - } - - } else if (!strncasecomp(buffer, "NO_DOT_FILES:", 13)) { - no_dotfiles = is_true(buffer+13); + ConfigUnion *q; +#endif - } else if (!strncasecomp(buffer, "NO_FILE_REFERER:", 16)) { - no_filereferer = is_true(buffer+16); + /* Most lines in the config file are comment lines. Weed them out + * now. Also, leading whitespace is ok, so trim it. + */ + name = LYSkipBlanks(buffer); -#ifndef VMS - } else if (!strncasecomp(buffer, "NO_FORCED_CORE_DUMP:", 20)) { - LYNoCore = is_true(buffer+20); -#endif /* !VMS */ + if (*name == '#') + continue; - } else if (!strncasecomp(buffer, "NO_FROM_HEADER:", 15)) { - LYNoFromHeader = is_true(buffer+15); + LYTrimTrailing(name); - } else if (!strncasecomp(buffer, "NO_ISMAP_IF_USEMAP:", 19)) { - LYNoISMAPifUSEMAP = is_true(buffer+19); + if (*name == 0) continue; - } else if (!strncasecomp(buffer, "no_proxy:", 9)) { - if (getenv("no_proxy") == NULL) { -#ifdef VMS - strcpy(temp, "no_proxy"); - Define_VMSLogical(temp, (char *)&buffer[9]); -#else - strcpy(temp, "no_proxy="); - StrAllocCopy(no_proxy_putenv_cmd, temp); - StrAllocCat(no_proxy_putenv_cmd, (char *)&buffer[9]); - putenv(no_proxy_putenv_cmd); -#endif /* VMS */ - } - - } else if (!strncasecomp(buffer, "NO_REFERER_HEADER:", 18)) { - LYNoRefererHeader = is_true(buffer+18); + /* Significant lines are of the form KEYWORD:WHATEVER */ + if ((value = strchr (name, ':')) == 0) { + /* fprintf (stderr, "Bad line-- no :\n"); */ + continue; } - break; - - case 'P': - if (!strncasecomp(buffer, "PERSONAL_MAILCAP:", 17)) { - StrAllocCopy(personal_type_map, buffer+17); - - } else if (!strncasecomp(buffer, "PERSONAL_EXTENSION_MAP:", 23)) { - StrAllocCopy(personal_extension_map, buffer+23); - } else if (!strncasecomp(buffer, "PREFERRED_CHARSET:", 18)) { - StrAllocCopy(pref_charset, buffer+18); + /* skip past colon, but replace ':' with 0 to make name meaningful */ + *value++ = 0; - } else if (!strncasecomp(buffer, "PREFERRED_LANGUAGE:", 19)) { - StrAllocCopy(language, buffer+19); - - } else if (!strncasecomp(buffer, "PREPEND_BASE_TO_SOURCE:", 23)) { - LYPrependBaseToSource = is_true(buffer+23); + /* + * Trim off any trailing comments. + * + * (Apparently, the original code considers a trailing comment + * valid only if preceded by a space character but is not followed + * by a colon. -- JED) + */ + if ((cp = strrchr (value, ':')) == 0) + cp = value; + if ((cp = strchr (cp, '#')) != 0) { + cp--; + if (isspace ((unsigned char) *cp)) + *cp = 0; + } - } else if (!strncasecomp(buffer, "PREPEND_CHARSET_TO_SOURCE:", 26)) { - LYPrependCharsetToSource = is_true(buffer+26); + tbl = Config_Table; + ch = TOUPPER(*name); + while (tbl->name != 0) { + char ch1 = tbl->name[0]; - } else if (!strncasecomp(buffer, "PRINTER:", 8)) { - add_printer_to_list(&buffer[8], &printers); - } - break; + if ((ch == TOUPPER(ch1)) + && (0 == strcasecomp (name, tbl->name))) + break; -#ifdef RAWDOSKEYHACK - case 'R': - if (!strncasecomp(buffer, "RAW_DOS_KEY_HACK:", 17)) { - raw_dos_key_hack = is_true(buffer+17); + tbl++; } - break; -#endif /* RAWDOSKEYHACK */ - case 'Q': - if (!strncasecomp(buffer, "QUIT_DEFAULT_YES:", 17)) { - LYQuitDefaultYes = is_true(buffer+17); + if (tbl->name == 0) { + /* Apparently, lynx ignores unknown keywords */ + /* fprintf (stderr, "%s not found in config file */ + continue; } - break; - - case 'S': - if (!strncasecomp(buffer, "SAVE_SPACE:", 11)) { - StrAllocCopy(lynx_save_space, buffer+11); - - } else if (!strncasecomp(buffer, "SCAN_FOR_BURIED_NEWS_REFS:", 26)) { - scan_for_buried_news_references = is_true(buffer+26); - - } else if (!strncasecomp(buffer, "SEEK_FRAG_AREA_IN_CUR:", 22)) { - LYSeekFragAREAinCur = is_true(buffer+22); - - } else if (!strncasecomp(buffer, "SEEK_FRAG_MAP_IN_CUR:", 21)) { - LYSeekFragMAPinCur = is_true(buffer+21); - } else if (!strncasecomp(buffer, "SET_COOKIES:", 12)) { - LYSetCookies = is_true(buffer+12); - - } else if (!strncasecomp(buffer, "SHOW_CURSOR:", 12)) { - LYShowCursor = is_true(buffer+12); - - } else if (!strncasecomp(buffer, "snews_proxy:", 12)) { - if (getenv("snews_proxy") == NULL) { -#ifdef VMS - strcpy(temp, "snews_proxy"); - Define_VMSLogical(temp, (char *)&buffer[12]); +#ifdef PARSE_DEBUG + q = tbl; #else - strcpy(temp, "snews_proxy="); - StrAllocCopy(snews_proxy_putenv_cmd, temp); - StrAllocCat(snews_proxy_putenv_cmd, (char *)&buffer[12]); - putenv(snews_proxy_putenv_cmd); -#endif /* VMS */ + q = (ConfigUnion *)(&(tbl->value)); +#endif + switch (tbl->type) { + case CONF_BOOL: + if (q->set_value != 0) + *(q->set_value) = is_true (value); + break; + + case CONF_FUN: + if (q->fun_value != 0) + (*(q->fun_value)) (value); + break; + + case CONF_INT: + if (q->int_value != 0) { + int ival; + /* Apparently, if an integer value is not present, then the + * value is not changed. So, use the sscanf function to make + * this determination. + */ + if (1 == sscanf (value, "%d", &ival)) + *(q->int_value) = ival; } + break; - } else if (!strncasecomp(buffer, "snewspost_proxy:", 16)) { - if (getenv("snewspost_proxy") == NULL) { -#ifdef VMS - strcpy(temp, "snewspost_proxy"); - Define_VMSLogical(temp, (char *)&buffer[16]); -#else - strcpy(temp, "snewspost_proxy="); - StrAllocCopy(snewspost_proxy_putenv_cmd, temp); - StrAllocCat(snewspost_proxy_putenv_cmd, (char *)&buffer[16]); - putenv(snewspost_proxy_putenv_cmd); -#endif /* VMS */ - } + case CONF_STR: + if (q->str_value != 0) + StrAllocCopy(*(q->str_value), value); + break; - } else if (!strncasecomp(buffer, "snewsreply_proxy:", 17)) { - if (getenv("snewsreply_proxy") == NULL) { + case CONF_ENV: + if (getenv (tbl->name) == 0) { #ifdef VMS - strcpy(temp, "snewsreply_proxy"); - Define_VMSLogical(temp, (char *)&buffer[17]); + Define_VMSLogical(tbl->name, value); #else - strcpy(temp, "snewsreply_proxy="); - StrAllocCopy(snewsreply_proxy_putenv_cmd, temp); - StrAllocCat(snewsreply_proxy_putenv_cmd, (char *)&buffer[17]); - putenv(snewsreply_proxy_putenv_cmd); -#endif /* VMS */ - } - - } else if (!strncasecomp(buffer, "SOFT_DQUOTES:", 13)) { - soft_dquotes = is_true(buffer+13); - - } else if (!strncasecomp(buffer, "STARTFILE:", 10)) { - StrAllocCopy(startfile, buffer+10); - - } else if (!strncasecomp(buffer, "STRIP_DOTDOT_URLS:", 18)) { - LYStripDotDotURLs = is_true(buffer+18); - - } else if (!strncasecomp(buffer, "SUBSTITUTE_UNDERSCORES:", 23)) { - use_underscore = is_true(buffer+23); - - } else if (!strncasecomp(buffer, "SUFFIX:", 7)) { - char *extention; - char *mime_type; - - if (strlen(buffer) > 9) { - extention = buffer + 7; - if ((mime_type = strchr(extention, ':')) != NULL) { - *mime_type++ = '\0'; - for (i = 0, j = 0; mime_type[i]; i++) { - if (mime_type[i] != ' ') { - mime_type[j++] = TOLOWER(mime_type[i]); - } - } - mime_type[j] = '\0'; - if (strstr(mime_type, "tex") != NULL || - strstr(mime_type, "postscript") != NULL || - strstr(mime_type, "sh") != NULL || - strstr(mime_type, "troff") != NULL || - strstr(mime_type, "rtf") != NULL) - HTSetSuffix(extention, mime_type, "8bit", 1.0); - else - HTSetSuffix(extention, mime_type, "binary", 1.0); - } - } - - } else if (!strncasecomp(buffer, "SYSTEM_EDITOR:", 14)) { - StrAllocCopy(editor, buffer+14); - system_editor = TRUE; - - } else if (!strncasecomp(buffer, "SYSTEM_MAIL:", 12)) { - StrAllocCopy(system_mail, buffer+12); - - } else if (!strncasecomp(buffer, "SYSTEM_MAIL_FLAGS:", 18)) { - StrAllocCopy(system_mail_flags, buffer+18); - } - break; - - case 'T': -#ifdef EXEC_LINKS - if (!strncasecomp(buffer, "TRUSTED_EXEC:", 13)) { - add_trusted(&buffer[13], EXEC_PATH); /* Add exec path */ - } -#endif /* EXEC_LINKS */ - -#ifdef LYNXCGI_LINKS - if (!strncasecomp(buffer, "TRUSTED_LYNXCGI:", 16)) { - add_trusted(&buffer[16], CGI_PATH); /* Add CGI path */ - } -#endif /* LYNXCGI_LINKS */ - break; - - case 'U': - if (!strncasecomp(buffer, "URL_DOMAIN_PREFIXES:", 20)) { - StrAllocCopy(URLDomainPrefixes, buffer+20); - - } else if (!strncasecomp(buffer, "URL_DOMAIN_SUFFIXES:", 20)) { - StrAllocCopy(URLDomainSuffixes, buffer+20); - -#ifdef DIRED_SUPPORT - } else if (!strncasecomp(buffer, "UPLOADER:", 9)) { - add_item_to_list(&buffer[9], &uploaders); -#endif /* DIRED_SUPPORT */ - -#ifdef VMS - } else if (!strncasecomp(buffer, "USE_FIXED_RECORDS:", 18)) { - UseFixedRecords = is_true(buffer+18); -#endif /* VMS */ - -#if defined(NCURSES_MOUSE_VERSION) || defined(USE_SLANG_MOUSE) - } else if(!strncasecomp(buffer, "USE_MOUSE:",10)) { - LYUseMouse = is_true(buffer+10); + char tmpbuf[MAX_LINE_BUFFER_LEN]; + sprintf (tmpbuf, "%s=%s", tbl->name, value); + StrAllocCopy(*(q->str_value), tmpbuf); + putenv (*(q->str_value)); #endif - - } else if (!strncasecomp(buffer, "USE_SELECT_POPUPS:", 18)) { - LYSelectPopups = is_true(buffer+18); - } - break; - - case 'V': - if (!strncasecomp(buffer, "VERBOSE_IMAGES:", 15)) { - verbose_img = is_true(buffer+15); - - } else if (!strncasecomp(buffer, "VI_KEYS_ALWAYS_ON:", 18)) { - vi_keys = is_true(buffer+18); - - } else if (!strncasecomp(buffer, "VIEWER:", 7)) { - char *mime_type; - char *viewer; - char *environment; - - if (strlen(buffer) > 9) { - mime_type = buffer + 7; - if ((viewer = strchr(mime_type, ':')) != NULL) { - *viewer++ = '\0'; - for (i = 0, j = 0; mime_type[i]; i++) { - if (mime_type[i] != ' ') { - mime_type[j++] = TOLOWER(mime_type[i]); - } - } - mime_type[j] = '\0'; - environment = strrchr(viewer, ':'); - if ((environment != NULL) && - (strlen(viewer) > 1) && *(environment-1) != '\\') { - *environment++ = '\0'; - remove_backslashes(viewer); - /* - * If environment equals xwindows then only - * assign the presentation if there is a display - * variable. - */ - if (!strcasecomp(environment,"XWINDOWS")) { - if ((cp = getenv(DISPLAY)) != NULL && - *cp != '\0') - HTSetPresentation(mime_type, viewer, - 1.0, 3.0, 0.0, 0); - } else if (!strcasecomp(environment,"NON_XWINDOWS")) { - if ((cp = getenv(DISPLAY)) == NULL || - *cp == '\0') - HTSetPresentation(mime_type, viewer, - 1.0, 3.0, 0.0, 0); - } else { - HTSetPresentation(mime_type, viewer, - 1.0, 3.0, 0.0, 0); - } - } else { - remove_backslashes(viewer); - HTSetPresentation(mime_type, viewer, - 1.0, 3.0, 0.0, 0); - } - } } + break; + + case CONF_INCLUDE: + /* include another file */ + read_cfg (value, cfg_filename, nesting_level + 1); + break; + + case CONF_ADD_ITEM: + if (q->add_value != 0) + add_item_to_list (value, q->add_value); + break; +#if defined(EXEC_LINKS) || defined(LYNXCGI_LINKS) + case CONF_ADD_TRUSTED: + add_trusted (value, q->def_value); + break; +#endif } - break; - - case 'W': - if (!strncasecomp(buffer, "wais_proxy:", 11)) { - if (getenv("wais_proxy") == NULL) { -#ifdef VMS - strcpy(temp, "wais_proxy"); - Define_VMSLogical(temp, (char *)&buffer[11]); -#else - strcpy(temp, "wais_proxy="); - StrAllocCopy(wais_proxy_putenv_cmd, temp); - StrAllocCat(wais_proxy_putenv_cmd, (char *)&buffer[11]); - putenv(wais_proxy_putenv_cmd); -#endif /* VMS */ - } - } - break; - - case 'X': - if (!strncasecomp(buffer, "XLOADIMAGE_COMMAND:", 19)) { - StrAllocCopy(XLoadImageCommand, (char *)&buffer[19]); - } - break; - - default: - break; + } - } /* end of Huge switch */ - } /* end of while */ - fclose(fp); + fclose (fp); /* * If any DOWNLOADER: commands have always_enabled set (:TRUE), @@ -1322,17 +1120,16 @@ PUBLIC void read_cfg ARGS3( * settings will not block presentation of a download menu * with those always_enabled options still available. - FM */ - if (downloaders != NULL) { - int count; + if (downloaders != 0) { lynx_html_item_type *cur_download; - for (count = 0, cur_download = downloaders; - cur_download != NULL; - cur_download = cur_download->next, count++) { + cur_download = downloaders; + while (cur_download != 0) { if (cur_download->always_enabled) { override_no_download = TRUE; break; } + cur_download = cur_download->next; } } } diff --git a/src/LYStrings.c b/src/LYStrings.c index b5fafc47..f3bb9b55 100644 --- a/src/LYStrings.c +++ b/src/LYStrings.c @@ -435,11 +435,11 @@ re_read: case 'C': c = RTARROW; break; case 'v': c = RTARROW; break; /* keypad right on pc ncsa telnet */ case 'D': c = LTARROW; break; - case 't': c = LTARROW; break; /* keypad left on pc ncsa telnet */ - case 'y': c = PGUP; break; /* keypad on pc ncsa telnet */ - case 's': c = PGDOWN; break; /* keypad on pc ncsa telnet */ - case 'w': c = HOME; break; /* keypad on pc ncsa telnet */ - case 'q': c = END; break; /* keypad on pc ncsa telnet */ + case 't': c = LTARROW; break; /* keypad left on pc ncsa telnet */ + case 'y': c = PGUP; break; /* keypad on pc ncsa telnet */ + case 's': c = PGDOWN; break; /* keypad on pc ncsa telnet */ + case 'w': c = HOME; break; /* keypad on pc ncsa telnet */ + case 'q': c = END_KEY; break; /* keypad on pc ncsa telnet */ case 'M': #ifdef USE_SLANG_MOUSE if ((c == 27) && (b == '[')) @@ -585,7 +585,7 @@ re_read: c = PGUP; break; case KEY_LL: /* home down or bottom (lower left) */ - c = END; + c = END_KEY; break; /* The keypad is arranged like this:*/ /* a1 up a3 */ @@ -601,14 +601,14 @@ re_read: c = DO_NOTHING; break; case KEY_C1: /* lower left of keypad */ - c = END; + c = END_KEY; break; case KEY_C3: /* lower right of keypad */ c = PGDOWN; break; #ifdef KEY_END case KEY_END: /* end key 001 */ - c = END; + c = END_KEY; break; #endif /* KEY_END */ #ifdef KEY_HELP @@ -708,6 +708,108 @@ re_read: } } +/* + * Convert a null-terminated string to lowercase + */ +PUBLIC void LYLowerCase ARGS1( + char *, buffer) +{ + size_t i; + for (i = 0; buffer[i]; i++) + buffer[i] = TOLOWER(buffer[i]); +} + +/* + * Convert a null-terminated string to uppercase + */ +PUBLIC void LYUpperCase ARGS1( + char *, buffer) +{ + size_t i; + for (i = 0; buffer[i]; i++) + buffer[i] = TOUPPER(buffer[i]); +} + +/* + * Remove ALL whitespace from a string (including embedded blanks). + */ +PUBLIC void LYRemoveBlanks ARGS1( + char *, buffer) +{ + if (buffer != 0) { + size_t i, j; + for (i = j = 0; buffer[i]; i++) + if (!isspace((unsigned char)(buffer[i]))) + buffer[j++] = buffer[i]; + buffer[j] = 0; + } +} + +/* + * Skip whitespace + */ +PUBLIC char * LYSkipBlanks ARGS1( + char *, buffer) +{ + while (isspace((unsigned char)(*buffer))) + buffer++; + return buffer; +} + +/* + * Skip non-whitespace + */ +PUBLIC char * LYSkipNonBlanks ARGS1( + char *, buffer) +{ + while (*buffer != 0 && !isspace((unsigned char)(*buffer))) + buffer++; + return buffer; +} + +/* + * Skip CONST whitespace + */ +PUBLIC CONST char * LYSkipCBlanks ARGS1( + CONST char *, buffer) +{ + while (isspace((unsigned char)(*buffer))) + buffer++; + return buffer; +} + +/* + * Skip CONST non-whitespace + */ +PUBLIC CONST char * LYSkipCNonBlanks ARGS1( + CONST char *, buffer) +{ + while (*buffer != 0 && !isspace((unsigned char)(*buffer))) + buffer++; + return buffer; +} + +/* + * Trim leading blanks from a string + */ +PUBLIC void LYTrimLeading ARGS1( + char *, buffer) +{ + char *skipped = LYSkipBlanks(buffer); + while ((*buffer++ = *skipped++) != 0) + ; +} + +/* + * Trim trailing blanks from a string + */ +PUBLIC void LYTrimTrailing ARGS1( + char *, buffer) +{ + size_t i = strlen(buffer); + while (i != 0 && isspace((unsigned char)buffer[i-1])) + buffer[--i] = 0; +} /* ** Display the current value of the string and allow the user @@ -794,7 +896,7 @@ PUBLIC int LYEdit1 ARGS4( if (MaxLen <= 0) return(0); /* Be defensive */ - length=strlen(&Buf[0]); + length = strlen(&Buf[0]); StrLen = length; switch (action) { @@ -940,13 +1042,11 @@ PUBLIC int LYEdit1 ARGS4( break; case LYE_UPPER: - for (i = 0; Buf[i]; i++) - Buf[i] = TOUPPER(Buf[i]); + LYUpperCase(Buf); break; case LYE_LOWER: - for (i = 0; Buf[i]; i++) - Buf[i] = TOLOWER(Buf[i]); + LYLowerCase(Buf); break; default: diff --git a/src/LYStrings.h b/src/LYStrings.h index bb4d70f2..deb6343f 100644 --- a/src/LYStrings.h +++ b/src/LYStrings.h @@ -77,7 +77,7 @@ extern char * SNACat PARAMS(( #define PGDOWN 260 /* 0x104 */ #define PGUP 261 /* 0x105 */ #define HOME 262 /* 0x106 */ -#define END 263 /* 0x107 */ +#define END_KEY 263 /* 0x107 */ #define F1 264 /* 0x108 */ #define DO_KEY 265 /* 0x109 */ #define FIND_KEY 266 /* 0x10A */ @@ -144,6 +144,24 @@ typedef struct _EditFieldData { #define LYE_AIX (LYE_LKCMD +1) /* Hex 97 */ +extern void LYLowerCase PARAMS(( + char * buffer)); +extern void LYUpperCase PARAMS(( + char * buffer)); +extern void LYRemoveBlanks PARAMS(( + char * buffer)); +extern char * LYSkipBlanks PARAMS(( + char * buffer)); +extern char * LYSkipNonBlanks PARAMS(( + char * buffer)); +extern CONST char * LYSkipCBlanks PARAMS(( + CONST char * buffer)); +extern CONST char * LYSkipCNonBlanks PARAMS(( + CONST char * buffer)); +extern void LYTrimLeading PARAMS(( + char * buffer)); +extern void LYTrimTrailing PARAMS(( + char * buffer)); extern void LYSetupEdit PARAMS(( EditFieldData * edit, char * old, diff --git a/src/LYUtils.c b/src/LYUtils.c index e78b86a3..8a100e85 100644 --- a/src/LYUtils.c +++ b/src/LYUtils.c @@ -1713,26 +1713,6 @@ PUBLIC void free_and_clear ARGS1( } /* - * Collapse (REMOVE) all spaces in the string. - */ -PUBLIC void collapse_spaces ARGS1( - char *, string) -{ - int i=0; - int j=0; - - if (!string) - return; - - for (; string[i] != '\0'; i++) - if (!isspace((unsigned char)string[i])) - string[j++] = string[i]; - - string[j] = '\0'; /* terminate */ - return; -} - -/* * Convert single or serial newlines to single spaces throughout a string * (ignore newlines if the preceding character is a space) and convert * tabs to single spaces. Don't ignore any explicit tabs or spaces if @@ -1838,9 +1818,9 @@ PUBLIC void statusline ARGS1( if ((temp = (unsigned char *)calloc(1, strlen(text) + 1)) == NULL) outofmem(__FILE__, "statusline"); if (kanji_code == EUC) { - TO_EUC((unsigned char *)text, temp); + TO_EUC(text, temp); } else if (kanji_code == SJIS) { - TO_SJIS((unsigned char *)text, temp); + TO_SJIS(text, temp); } else { for (i = 0, j = 0; text[i]; i++) { if (text[i] != '\033') { @@ -2343,8 +2323,7 @@ PUBLIC int LYCheckForProxyURL ARGS1( return(0); /* kill beginning spaces */ - while (isspace((unsigned char)*cp)) - cp++; + cp = LYSkipBlanks(cp); /* * Check for a colon, and if present, @@ -2373,6 +2352,26 @@ PUBLIC int LYCheckForProxyURL ARGS1( } /* + * Compare a "type:" string, replacing it by the comparison-string if it + * matches (and return true in that case). + */ +static BOOLEAN compare_type ARGS3( + char *, tst, + char *, cmp, + size_t, len) +{ + if (!strncasecomp(tst, cmp, len)) { + if (strncmp(tst, cmp, len)) { + size_t i; + for (i = 0; i < len; i++) + tst[i] = cmp[i]; + } + return TRUE; + } + return FALSE; +} + +/* ** Must recognize a URL and return the type. ** If recognized, based on a case-insensitive ** analyis of the scheme field, ensures that @@ -2389,7 +2388,6 @@ PUBLIC int is_url ARGS1( { char *cp = filename; char *cp1; - int i; /* * Don't crash on an empty argument. @@ -2406,8 +2404,7 @@ PUBLIC int is_url ARGS1( /* * Kill beginning spaces. */ - while (isspace((unsigned char)*cp)) - cp++; + cp = LYSkipBlanks(cp); /* * Can't be a URL if it starts with a slash. @@ -2424,79 +2421,43 @@ PUBLIC int is_url ARGS1( StrAllocCat(cp,"/"); #endif - if (!strncasecomp(cp, "news:", 5)) { - if (strncmp(cp, "news", 4)) { - for (i = 0; i < 4; i++) - cp[i] = TOLOWER(cp[i]); - } + if (compare_type(cp, "news:", 5)) { return(NEWS_URL_TYPE); - } else if (!strncasecomp(cp, "nntp:", 5)) { - if (strncmp(cp, "nntp", 4)) { - for (i = 0; i < 4; i++) - cp[i] = TOLOWER(cp[i]); - } + } else if (compare_type(cp, "nntp:", 5)) { return(NNTP_URL_TYPE); - } else if (!strncasecomp(cp, "snews:", 6)) { - if (strncmp(cp, "snews", 5)) { - for (i = 0; i < 5; i++) - cp[i] = TOLOWER(cp[i]); - } + } else if (compare_type(cp, "snews:", 6)) { return(SNEWS_URL_TYPE); - } else if (!strncasecomp(cp, "newspost:", 9)) { + } else if (compare_type(cp, "newspost:", 9)) { /* * Special Lynx type to handle news posts. */ - if (strncmp(cp, "newspost", 8)) { - for (i = 0; i < 8; i++) - cp[i] = TOLOWER(cp[i]); - } return(NEWSPOST_URL_TYPE); - } else if (!strncasecomp(cp, "newsreply:", 10)) { + } else if (compare_type(cp, "newsreply:", 10)) { /* * Special Lynx type to handle news replies (followups). */ - if (strncmp(cp, "newsreply", 9)) { - for (i = 0; i < 9; i++) - cp[i] = TOLOWER(cp[i]); - } return(NEWSREPLY_URL_TYPE); - } else if (!strncasecomp(cp, "snewspost:", 10)) { + } else if (compare_type(cp, "snewspost:", 10)) { /* * Special Lynx type to handle snews posts. */ - if (strncmp(cp, "snewspost", 9)) { - for (i = 0; i < 9; i++) - cp[i] = TOLOWER(cp[i]); - } return(NEWSPOST_URL_TYPE); - } else if (!strncasecomp(cp, "snewsreply:", 11)) { + } else if (compare_type(cp, "snewsreply:", 11)) { /* * Special Lynx type to handle snews replies (followups). */ - if (strncmp(cp, "snewsreply", 10)) { - for (i = 0; i < 10; i++) - cp[i] = TOLOWER(cp[i]); - } return(NEWSREPLY_URL_TYPE); - } else if (!strncasecomp(cp, "mailto:", 7)) { - if (strncmp(cp, "mailto", 6)) { - for (i = 0; i < 6; i++) - cp[i] = TOLOWER(cp[i]); - } + } else if (compare_type(cp, "mailto:", 7)) { return(MAILTO_URL_TYPE); - } else if (!strncasecomp(cp, "file:", 5)) { - if (strncmp(cp, "file", 4)) { - for (i = 0; i < 4; i++) - cp[i] = TOLOWER(cp[i]); - } + } else if (compare_type(cp, "file:", 5)) { if (LYisLocalFile(cp)) { return(FILE_URL_TYPE); } else if (cp[5] == '/' && cp[6] == '/') { @@ -2505,116 +2466,72 @@ PUBLIC int is_url ARGS1( return(0); } - } else if (!strncasecomp(cp, "data:", 5)) { - if (strncmp(cp, "data", 4)) { - for (i = 0; i < 4; i++) - cp[i] = TOLOWER(cp[i]); - } + } else if (compare_type(cp, "data:", 5)) { return(DATA_URL_TYPE); - } else if (!strncasecomp(cp, "lynxexec:", 9)) { + } else if (compare_type(cp, "lynxexec:", 9)) { /* * Special External Lynx type to handle execution * of commands or scripts which require a pause to * read the screen upon completion. */ - if (strncmp(cp, "lynxexec", 8)) { - for (i = 0; i < 8; i++) - cp[i] = TOLOWER(cp[i]); - } return(LYNXEXEC_URL_TYPE); - } else if (!strncasecomp(cp, "lynxprog:", 9)) { + } else if (compare_type(cp, "lynxprog:", 9)) { /* * Special External Lynx type to handle execution * of commans, sriptis or programs with do not * require a pause to read screen upon completion. */ - if (strncmp(cp, "lynxprog", 8)) { - for (i = 0; i < 8; i++) - cp[i] = TOLOWER(cp[i]); - } return(LYNXPROG_URL_TYPE); - } else if (!strncasecomp(cp, "lynxcgi:", 8)) { + } else if (compare_type(cp, "lynxcgi:", 8)) { /* * Special External Lynx type to handle cgi scripts. */ - if (strncmp(cp, "lynxcgi", 7)) { - for (i = 0; i < 7; i++) - cp[i] = TOLOWER(cp[i]); - } return(LYNXCGI_URL_TYPE); - } else if (!strncasecomp(cp, "LYNXPRINT:", 10)) { + } else if (compare_type(cp, "LYNXPRINT:", 10)) { /* * Special Internal Lynx type. */ - if (strncmp(cp, "LYNXPRINT", 9)) { - for (i = 0; i < 9; i++) - cp[i] = TOUPPER(cp[i]); - } return(LYNXPRINT_URL_TYPE); - } else if (!strncasecomp(cp, "LYNXDOWNLOAD:", 13)) { + } else if (compare_type(cp, "LYNXDOWNLOAD:", 13)) { /* * Special Internal Lynx type. */ - if (strncmp(cp, "LYDOWNLOAD", 12)) { - for (i = 0; i < 12; i++) - cp[i] = TOUPPER(cp[i]); - } return(LYNXDOWNLOAD_URL_TYPE); - } else if (!strncasecomp(cp, "LYNXDIRED:", 10)) { + } else if (compare_type(cp, "LYNXDIRED:", 10)) { /* * Special Internal Lynx type. */ - if (strncmp(cp, "LYNXDIRED", 9)) { - for (i = 0; i < 9; i++) - cp[i] = TOUPPER(cp[i]); - } return(LYNXDIRED_URL_TYPE); - } else if (!strncasecomp(cp, "LYNXHIST:", 9)) { + } else if (compare_type(cp, "LYNXHIST:", 9)) { /* * Special Internal Lynx type. */ - if (strncmp(cp, "LYNXHIST", 8)) { - for (i = 0; i < 8; i++) - cp[i] = TOUPPER(cp[i]); - } return(LYNXHIST_URL_TYPE); - } else if (!strncasecomp(cp, "LYNXKEYMAP:", 11)) { + } else if (compare_type(cp, "LYNXKEYMAP:", 11)) { /* * Special Internal Lynx type. */ - if (strncmp(cp, "LYNXKEYMAP", 10)) { - for (i = 0; i < 10; i++) - cp[i] = TOUPPER(cp[i]); - } return(LYNXKEYMAP_URL_TYPE); - } else if (!strncasecomp(cp, "LYNXIMGMAP:", 11)) { + } else if (compare_type(cp, "LYNXIMGMAP:", 11)) { /* * Special Internal Lynx type. */ - if (strncmp(cp, "LYNXIMGMAP", 10)) { - for (i = 0; i < 10; i++) - cp[i] = TOUPPER(cp[i]); - } (void)is_url(&cp[11]); return(LYNXIMGMAP_URL_TYPE); - } else if (!strncasecomp(cp, "LYNXCOOKIE:", 11)) { + } else if (compare_type(cp, "LYNXCOOKIE:", 11)) { /* * Special Internal Lynx type. */ - if (strncmp(cp, "LYNXCOOKIE", 10)) { - for (i = 0; i < 10; i++) - cp[i] = TOUPPER(cp[i]); - } return(LYNXCOOKIE_URL_TYPE); } else if (strstr((cp+3), "://") == NULL) { @@ -2626,25 +2543,13 @@ PUBLIC int is_url ARGS1( */ return(LYCheckForProxyURL(filename)); - } else if (!strncasecomp(cp, "http:", 5)) { - if (strncmp(cp, "http", 4)) { - for (i = 0; i < 4; i++) - cp[i] = TOLOWER(cp[i]); - } + } else if (compare_type(cp, "http:", 5)) { return(HTTP_URL_TYPE); - } else if (!strncasecomp(cp, "https:", 6)) { - if (strncmp(cp, "https", 5)) { - for (i = 0; i < 5; i++) - cp[i] = TOLOWER(cp[i]); - } + } else if (compare_type(cp, "https:", 6)) { return(HTTPS_URL_TYPE); - } else if (!strncasecomp(cp, "gopher:", 7)) { - if (strncmp(cp, "gopher", 6)) { - for (i = 0; i < 6; i++) - cp[i] = TOLOWER(cp[i]); - } + } else if (compare_type(cp, "gopher:", 7)) { if ((cp1 = strchr(cp+11,'/')) != NULL) { if (TOUPPER(*(cp1+1)) == 'H' || *(cp1+1) == 'w') @@ -2660,67 +2565,31 @@ PUBLIC int is_url ARGS1( return(GOPHER_URL_TYPE); } - } else if (!strncasecomp(cp, "ftp:", 4)) { - if (strncmp(cp, "ftp", 3)) { - for (i = 0; i < 3; i++) - cp[i] = TOLOWER(cp[i]); - } + } else if (compare_type(cp, "ftp:", 4)) { return(FTP_URL_TYPE); - } else if (!strncasecomp(cp, "wais:", 5)) { - if (strncmp(cp, "wais", 4)) { - for (i = 0; i < 4; i++) - cp[i] = TOLOWER(cp[i]); - } + } else if (compare_type(cp, "wais:", 5)) { return(WAIS_URL_TYPE); - } else if (!strncasecomp(cp, "telnet:", 7)) { - if (strncmp(cp, "telnet", 6)) { - for (i = 0; i < 6; i++) - cp[i] = TOLOWER(cp[i]); - } + } else if (compare_type(cp, "telnet:", 7)) { return(TELNET_URL_TYPE); - } else if (!strncasecomp(cp, "tn3270:", 7)) { - if (strncmp(cp, "tn", 2)) { - for (i = 0; i < 2; i++) - cp[i] = TOLOWER(cp[i]); - } + } else if (compare_type(cp, "tn3270:", 7)) { return(TN3270_URL_TYPE); - } else if (!strncasecomp(cp, "rlogin:", 7)) { - if (strncmp(cp, "rlogin", 6)) { - for (i = 0; i < 6; i++) - cp[i] = TOLOWER(cp[i]); - } + } else if (compare_type(cp, "rlogin:", 7)) { return(RLOGIN_URL_TYPE); - } else if (!strncasecomp(cp, "cso:", 4)) { - if (strncmp(cp, "cso", 3)) { - for (i = 0; i < 3; i++) - cp[i] = TOLOWER(cp[i]); - } + } else if (compare_type(cp, "cso:", 4)) { return(CSO_URL_TYPE); - } else if (!strncasecomp(cp, "finger:", 7)) { - if (strncmp(cp, "finger", 6)) { - for (i = 0; i < 6; i++) - cp[i] = TOLOWER(cp[i]); - } + } else if (compare_type(cp, "finger:", 7)) { return(FINGER_URL_TYPE); - } else if (!strncasecomp(cp, "afs:", 4)) { - if (strncmp(cp, "afs", 3)) { - for (i = 0; i < 3; i++) - cp[i] = TOLOWER(cp[i]); - } + } else if (compare_type(cp, "afs:", 4)) { return(AFS_URL_TYPE); - } else if (!strncasecomp(cp, "prospero:", 9)) { - if (strncmp(cp, "prospero", 8)) { - for (i = 0; i < 8; i++) - cp[i] = TOLOWER(cp[i]); - } + } else if (compare_type(cp, "prospero:", 9)) { return(PROSPERO_URL_TYPE); } else { @@ -3311,44 +3180,64 @@ PUBLIC void change_sug_filename ARGS1( } /* + * Construct a name for 'tempname()' + */ +PRIVATE char *fmt_tempname ARGS3( + char *, result, + unsigned, counter, + char *, suffix) +{ + sprintf(result, +#ifdef FNAMES_8_3 + "%s%u%u%s", +#else + "%sL%u-%uTMP%s", +#endif + lynx_temp_space, (unsigned)getpid(), counter, suffix); + return result; +} + +/* + * 'tempname()' requires that the resulting file does not exist. Test this + * by trying to open it. + */ +PRIVATE BOOLEAN bad_tempname ARGS3( + char *, result, + unsigned, counter, + char *, suffix) +{ + FILE *fp; + + if ((fp = fopen(fmt_tempname(result, counter, suffix), "r")) != 0) { + fclose(fp); + CTRACE(tfp, "tempname: file '%s' already exists!\n", result); + return TRUE; + } + + return FALSE; +} + +/* * To create standard temporary file names. */ PUBLIC void tempname ARGS2( char *, namebuffer, int, action) { - static int counter = 0; - FILE *fp = NULL; + static unsigned counter = 0; #ifdef FNAMES_8_3 - int LYMaxTempCount = 1000; /* Arbitrary limit. Make it configurable? */ + unsigned LYMaxTempCount = 1000; /* Arbitrary limit. Make it configurable? */ #else - int LYMaxTempCount = 10000; /* Arbitrary limit. Make it configurable? */ + unsigned LYMaxTempCount = 10000; /* Arbitrary limit. Make it configurable? */ #endif /* FNAMES_8_3 */ if (action == REMOVE_FILES) { /* * Remove all temporary files with .txt or .html suffixes. - FM */ - for (; counter > 0; counter--) { -#ifdef FNAMES_8_3 - sprintf(namebuffer, - "%s%d%u.txt", - lynx_temp_space, (int)getpid(), counter-1); - remove(namebuffer); - sprintf(namebuffer, - "%s%d%u%s", - lynx_temp_space, (int)getpid(), counter-1, HTML_SUFFIX); - remove(namebuffer); -#else - sprintf(namebuffer, - "%sL%d-%uTMP.txt", - lynx_temp_space, (int)getpid(), counter-1); - remove(namebuffer); - sprintf(namebuffer, - "%sL%d-%uTMP%s", - lynx_temp_space, (int)getpid(), counter-1, HTML_SUFFIX); - remove(namebuffer); -#endif /* FNAMES_8_3 */ + for (; counter != 0; counter--) { + remove(fmt_tempname(namebuffer, counter-1, ".txt")); + remove(fmt_tempname(namebuffer, counter-1, HTML_SUFFIX)); } } else { /* @@ -3368,51 +3257,9 @@ PUBLIC void tempname ARGS2( * should be done consistently by always using HTML_SUFFIX * where filenames are generated for new local files. - kw */ -#ifdef FNAMES_8_3 - sprintf(namebuffer, - "%s%d%u.txt", - lynx_temp_space, (int)getpid(), counter); -#else - sprintf(namebuffer, - "%sL%d-%uTMP.txt", - lynx_temp_space, (int)getpid(), counter); -#endif /* FNAMES_8_3 */ - if ((fp = fopen(namebuffer, "r")) != NULL) { - fclose(fp); - CTRACE(tfp, "tempname: file '%s' already exists!\n", - namebuffer); - counter++; - continue; - } -#ifdef FNAMES_8_3 - sprintf(namebuffer, - "%s%d%u.bin", - lynx_temp_space, (int)getpid(), counter); -#else - sprintf(namebuffer, - "%sL%d-%uTMP.bin", - lynx_temp_space, (int)getpid(), counter); -#endif /* FNAMES_8_3 */ - if ((fp = fopen(namebuffer, "r")) != NULL) { - fclose(fp); - CTRACE(tfp, "tempname: file '%s' already exists!\n", - namebuffer); - counter++; - continue; - } -#ifdef FNAMES_8_3 - sprintf(namebuffer, - "%s%d%u%s", - lynx_temp_space, (int)getpid(), counter++, HTML_SUFFIX); -#else - sprintf(namebuffer, - "%sL%d-%uTMP%s", - lynx_temp_space, (int)getpid(), counter++, HTML_SUFFIX); -#endif /* FNAMES_8_3 */ - if ((fp = fopen(namebuffer, "r")) != NULL) { - fclose(fp); - CTRACE(tfp, "tempname: file '%s' already exists!\n", - namebuffer); + if (bad_tempname(namebuffer, counter, ".txt") + || bad_tempname(namebuffer, counter, ".bin") + || bad_tempname(namebuffer, counter, HTML_SUFFIX)) { continue; } /* @@ -3423,7 +3270,7 @@ PUBLIC void tempname ARGS2( * a spoof. The file name can be reused if it is written * to on receipt of this name, and thereafter accessed * for reading. Note that if writing to a file is to - * be followed by reading it, as it the usual case for + * be followed by reading it, as is the usual case for * Lynx, the spoof attempt will be apparent, and the user * can take appropriate action. - FM */ @@ -3452,7 +3299,7 @@ PUBLIC int number2arrows ARGS1( { switch(number) { case '1': - number=END; + number=END_KEY; break; case '2': number=DNARROW; @@ -3632,8 +3479,7 @@ PUBLIC void parse_restrictions ARGS1( p = s; while (*p) { - while (isspace((unsigned char)*p)) - p++; + p = LYSkipBlanks(p); if (*p == '\0') break; word = p; @@ -3699,12 +3545,7 @@ PUBLIC int LYCheckMail NOARGS return 0; } user[userlen] = '\0'; - while (user[0] && - /* - * Suck up trailing spaces. - */ - isspace((unsigned char)user[--userlen])) - user[userlen] = '\0'; + LYTrimTrailing(user); } /* Minimum report interval is 60 sec. */ @@ -3909,9 +3750,7 @@ PUBLIC void LYConvertToURL ARGS1( if ((cp = strchr(file_name, ';')) != NULL) { *cp = '\0'; } - for (cp = file_name; *cp; cp++) { - *cp = TOLOWER(*cp); - } + LYLowerCase(file_name); StrAllocCat(*AllocatedString, HTVMS_wwwName(file_name)); if ((cp = strchr(old_string, ';')) != NULL) { StrAllocCat(*AllocatedString, cp); @@ -3934,9 +3773,7 @@ PUBLIC void LYConvertToURL ARGS1( /* * Yup, we got it! */ - for (cp = dir_name; *cp; cp++) { - *cp = TOLOWER(*cp); - } + LYLowerCase(dir_name); StrAllocCat(*AllocatedString, dir_name); if (fragment != NULL) { StrAllocCat(*AllocatedString, fragment); @@ -5476,10 +5313,6 @@ extern int errno; #if defined(STDC_HEADERS) || defined(USG) #include <string.h> -#ifdef NOTDEFINED -#define index strchr -#define bcopy(s, d, n) memcpy((d), (s), (n)) -#endif /* NOTDEFINED */ #else /* Not (STDC_HEADERS or USG): */ #include <strings.h> #endif /* STDC_HEADERS or USG */ diff --git a/src/LYUtils.h b/src/LYUtils.h index 29ab92c4..790d84a2 100644 --- a/src/LYUtils.h +++ b/src/LYUtils.h @@ -10,7 +10,6 @@ extern void highlight PARAMS((int flag, int cur, char *target)); extern void free_and_clear PARAMS((char **obj)); -extern void collapse_spaces PARAMS((char *string)); extern void convert_to_spaces PARAMS((char *string, BOOL condense)); extern char * strip_trailing_slash PARAMS((char * dirname)); extern void statusline PARAMS((CONST char *text)); diff --git a/src/LYrcFile.c b/src/LYrcFile.c index 64aadeff..ecb3f78b 100644 --- a/src/LYrcFile.c +++ b/src/LYrcFile.c @@ -55,8 +55,7 @@ PUBLIC void read_rc NOPARAMS /* * Remove any trailing white space. */ - while (line_buffer[0] && isspace(line_buffer[strlen(line_buffer)-1])) - line_buffer[strlen(line_buffer)-1] = '\0'; + LYTrimTrailing(line_buffer); /* * Skip any comment or blank lines. @@ -81,8 +80,7 @@ PUBLIC void read_rc NOPARAMS if ((cp2 = (char *)strchr(cp, '=')) != NULL) cp = cp2 + 1; - while (isspace(*cp)) - cp++; /* get rid of spaces */ + cp = LYSkipBlanks(cp); StrAllocCopy(editor, cp); /* @@ -93,8 +91,7 @@ PUBLIC void read_rc NOPARAMS if ((cp2 = (char *)strchr(cp,'=')) != NULL) cp = cp2 + 1; - while (isspace(*cp)) - cp++; /* get rid of spaces */ + cp = LYSkipBlanks(cp); /* * Since this is the "Default Bookmark File", we save it @@ -113,8 +110,7 @@ PUBLIC void read_rc NOPARAMS if ((cp2 = (char *)strchr(cp, '=')) != NULL) cp = (cp2 + 1); - while (isspace(*cp)) - cp++; /* get rid of spaces */ + cp = LYSkipBlanks(cp); if (!strncasecomp(cp, "standard", 8)) { LYMultiBookmarks = TRUE; LYMBMAdvanced = FALSE; @@ -181,8 +177,7 @@ PUBLIC void read_rc NOPARAMS /* * Eat spaces in front of description. */ - while (isspace(*MBM_cp1)) - MBM_cp1++; + MBM_cp1 = LYSkipBlanks(MBM_cp1); while (*MBM_cp1) MBM_line[MBM_i2++] = *MBM_cp1++; MBM_line[MBM_i2++] = '\0'; @@ -205,8 +200,7 @@ PUBLIC void read_rc NOPARAMS if ((cp2 = (char *)strchr(cp, '=')) != NULL) cp = cp2 + 1; - while (isspace(*cp)) - cp++; /* get rid of spaces */ + cp = LYSkipBlanks(cp); if (!strncasecomp(cp, "BY_FILENAME", 11)) HTfileSortMethod = FILE_BY_NAME; else if (!strncasecomp(cp, "BY_TYPE", 7)) @@ -225,8 +219,7 @@ PUBLIC void read_rc NOPARAMS if ((cp2 = (char *)strchr(cp, '=')) != NULL) cp = cp2 + 1; - while (isspace(*cp)) - cp++; /* get rid of spaces */ + cp = LYSkipBlanks(cp); StrAllocCopy(personal_mail_address, cp); /* @@ -238,8 +231,7 @@ PUBLIC void read_rc NOPARAMS if ((cp2 = (char *)strchr(cp, '=')) != NULL) cp = cp2 + 1; - while (isspace(*cp)) - cp++; /* get rid of spaces */ + cp = LYSkipBlanks(cp); if (!strncasecomp(cp, "on", 2)) case_sensitive = TRUE; else @@ -255,8 +247,7 @@ PUBLIC void read_rc NOPARAMS if ((cp2 = (char *)strchr(cp, '=')) != NULL) cp = cp2 + 1; - while (isspace(*cp)) - cp++; /* get rid of spaces */ + cp = LYSkipBlanks(cp); for (; LYchar_set_names[i]; i++) { if (!strncmp(cp, LYchar_set_names[i], strlen(cp))) { current_char_set=i; @@ -274,8 +265,7 @@ PUBLIC void read_rc NOPARAMS if ((cp2 = (char *)strchr(cp, '=')) != NULL) cp = cp2 + 1; - while (isspace(*cp)) - cp++; /* get rid of spaces */ + cp = LYSkipBlanks(cp); StrAllocCopy(language, cp); /* @@ -287,8 +277,7 @@ PUBLIC void read_rc NOPARAMS if ((cp2 = (char *)strchr(cp, '=')) != NULL) cp = cp2 + 1; - while (isspace(*cp)) - cp++; /* get rid of spaces */ + cp = LYSkipBlanks(cp); StrAllocCopy(pref_charset, cp); /* @@ -299,8 +288,7 @@ PUBLIC void read_rc NOPARAMS if ((cp2 = (char * )strchr(cp, '=')) != NULL) cp = cp2 + 1; - while (isspace(*cp)) - cp++; /* get rid of spaces */ + cp = LYSkipBlanks(cp); if (!strncasecomp(cp, "on", 2)) vi_keys = TRUE; else @@ -314,8 +302,7 @@ PUBLIC void read_rc NOPARAMS if ((cp2 = (char *)strchr(cp, '=')) != NULL) cp = cp2 + 1; - while (isspace(*cp)) - cp++; /* get rid of spaces */ + cp = LYSkipBlanks(cp); if (!strncasecomp(cp, "on", 2)) emacs_keys = TRUE; else @@ -329,8 +316,7 @@ PUBLIC void read_rc NOPARAMS if ((cp2 = (char * )strchr(cp, '=')) != NULL) cp = cp2 + 1; - while (isspace(*cp)) - cp++; /* get rid of spaces */ + cp = LYSkipBlanks(cp); if (!strncasecomp(cp, "on", 2)) show_dotfiles = TRUE; else @@ -344,8 +330,7 @@ PUBLIC void read_rc NOPARAMS if ((cp2 = (char * )strchr(cp, '=')) != NULL) cp = cp2 + 1; - while (isspace(*cp)) - cp++; /* get rid of spaces */ + cp = LYSkipBlanks(cp); if (!strncasecomp(cp, "always", 6)) { LYrcShowColor = SHOW_COLOR_ALWAYS; #if defined(USE_SLANG) || defined(COLOR_CURSES) @@ -368,8 +353,7 @@ PUBLIC void read_rc NOPARAMS if ((cp2 = (char * )strchr(cp, '=')) != NULL) cp = cp2 + 1; - while (isspace(*cp)) - cp++; /* get rid of spaces */ + cp = LYSkipBlanks(cp); if (!strncasecomp(cp, "off", 3)) LYSelectPopups = FALSE; else @@ -383,8 +367,7 @@ PUBLIC void read_rc NOPARAMS if ((cp2 = (char * )strchr(cp, '=')) != NULL) cp = cp2 + 1; - while (isspace(*cp)) - cp++; /* get rid of spaces */ + cp = LYSkipBlanks(cp); if (!strncasecomp(cp, "off", 3)) LYShowCursor = FALSE; else @@ -398,8 +381,7 @@ PUBLIC void read_rc NOPARAMS if ((cp2 = (char *)strchr(cp, '=')) != NULL) cp = cp2 + 1; - while (isspace(*cp)) - cp++; /* get rid of spaces */ + cp = LYSkipBlanks(cp); if (LYstrstr(cp, "LINKS_ARE_NUMBERED")) keypad_mode = LINKS_ARE_NUMBERED; else if (LYstrstr(cp, "LINKS_AND_FORM_FIELDS_ARE_NUMBERED")) @@ -417,8 +399,7 @@ PUBLIC void read_rc NOPARAMS if ((cp2 = (char *)strchr(cp, '=')) != NULL) cp = cp2 + 1; - while (isspace(*cp)) - cp++; /* get rid of spaces */ + cp = LYSkipBlanks(cp); for (; LYLineeditNames[i]; i++) { if (!strncmp(cp, LYLineeditNames[i], strlen(cp))) { current_lineedit = i; @@ -435,8 +416,7 @@ PUBLIC void read_rc NOPARAMS if ((cp2 = (char *)strchr(cp,'=')) != NULL) cp = cp2 + 1; - while (isspace(*cp)) - cp++; /* get rid of spaces */ + cp = LYSkipBlanks(cp); if (LYstrstr(cp, "FILES_FIRST") != NULL) { dir_list_style = FILES_FIRST; } else if (LYstrstr(cp,"DIRECTORIES_FIRST") != NULL) { @@ -454,8 +434,7 @@ PUBLIC void read_rc NOPARAMS if ((cp2 = (char *)strchr(cp, '=')) != NULL) cp = cp2 + 1; - while (isspace(*cp)) - cp++; /* get rid of spaces */ + cp = LYSkipBlanks(cp); if (LYstrstr(cp, "ADVANCED") != NULL) { user_mode = ADVANCED_MODE; } else if (LYstrstr(cp,"INTERMEDIATE") != NULL) { @@ -474,9 +453,7 @@ PUBLIC void read_rc NOPARAMS if ((cp2 = (char *)strchr(cp, '=')) != NULL) cp = cp2 + 1; - while (isspace(*cp)) - cp++; /* get rid of spaces */ - + cp = LYSkipBlanks(cp); if (!strncasecomp(cp, "on", 2)) local_exec = TRUE; else @@ -491,8 +468,7 @@ PUBLIC void read_rc NOPARAMS if ((cp2 = (char *)strchr(cp, '=')) != NULL) cp = cp2 + 1; - while (isspace(*cp)) - cp++; /* get rid of spaces */ + cp = LYSkipBlanks(cp); if (!strncasecomp(cp, "on", 2)) local_exec_on_local_files = TRUE; else diff --git a/src/chrtrans/README.format b/src/chrtrans/README.format index 4ced0a14..5e8d029c 100644 --- a/src/chrtrans/README.format +++ b/src/chrtrans/README.format @@ -26,7 +26,7 @@ b) directives: start with a keyword which may be abbreviated to one letter (first letter must be capitalized), followed by space and a value. Currently recognized: - + OptionName The name under which this should appear on the O)ptions screen in the list for Display Character Set @@ -53,7 +53,7 @@ c) character translation definitions: 0x41 U+0041 U+0391 ... and are used for "forward" translation (mapping this charset to Unicode) - AS WELL AS "back" translation (mapping Unicodes to an 8-bit + AS WELL AS "back" translation (mapping Unicodes to an 8-bit [incl. 7-bit ASCII] code). For the "forward" direction, only the first Unicode is used; for @@ -63,7 +63,7 @@ c) character translation definitions: The above example line would tell the chartrans mechanism: "For this charset, code position 65 [hex 0x41] contains Unicode U+0041 (LATIN CAPITAL LETTER A). For translation of Unicodes to - this charset, use byte value 65 [hex 0x41] for U+0041 (LATIN CAPITAL + this charset, use byte value 65 [hex 0x41] for U+0041 (LATIN CAPITAL LETTER A) as well as for U+0391 (GREEK CAPITAL LETTER ALPHA)." [Note that for bytes in the ASCII range 0x00-0x7F, the forward translations @@ -89,10 +89,10 @@ d) string replacement definitions: U+00cd:I' - which would mean "Replace Unicode U+00cd (LATIN CAPITAL LETTER I WITH + which would mean "Replace Unicode U+00cd (LATIN CAPITAL LETTER I WITH ACUTE" with the string (consisting of two character) I' (if no other translation is available)." Please note that replacement definitions - in certnain charset table will override ones from Default table. + in certain charset table will override ones from the Default table. Note that everything after the ':' is currently taken VERBATIM, so careful with trailing blanks etc. @@ -111,7 +111,7 @@ d) string replacement definitions: Motivation: -- It is an extention of the format already in use for Linux (kernel, +- It is an extension of the format already in use for Linux (kernel, kbd package), those files can be used with some minimal editing. - It is easy to convert Unicode tables for other charsets, as they diff --git a/src/chrtrans/README.tables b/src/chrtrans/README.tables index be6dac6a..b9311729 100644 --- a/src/chrtrans/README.tables +++ b/src/chrtrans/README.tables @@ -1,12 +1,12 @@ -The translation table files in this directory are _examples only_. -They were collected from several sources (among them ftp://ftp.unicode.org, -Linux kbd package, ftp://dkuug.dk/) and are believed to be correct -in their mappings, but not checked in detail. The Unicode/UCS2 values -for some of the RFC 1345 Mnemonic codes are out of date, a cleanup and -update would be needed for serious use. +The translation table files in this directory were collected from +several sources (among them ftp://ftp.unicode.org, Linux kbd package, +ftp://dkuug.dk/) and are believed to be correct in their mappings, +but not checked in detail. The Unicode/UCS2 values +for some of the RFC 1345 Mnemonic codes are out of date, +a cleanup and update would be needed for serious use. More translation files can be easily provided (and new character entities -added to entities.h), this set is just to test whether the system works +added to entities.h), this set is just to test whether the system works in principle (and also how it behaves with incomplete data...) See the file README.format for a brief explanation of what's in the @@ -27,7 +27,7 @@ charset known to Lynx) you currently have to manually edit UCdomap.c, in two places: a) Near the top, you will find a bunch of lines (some may be commented out) - + #include "<fn>.h" Add or comment out as you wish. But it is probably safest to leave the @@ -44,7 +44,7 @@ did under a)...) [The <something> is derived from the charset's MIME name. if in doubt, check the last lines of the corresponding ...uni.h file.] c) To let make automatically notice when you have changed one of the - table files, and automatically regenerate the *uni.h file(s), + table files, and automatically regenerate the *uni.h file(s), you also have to add any new tables to both src/Makefile *and* src/chrtrans/Makefile. Or, for auto-config, the equivalent files named makefile.in before running ./configure, or makefile after running diff --git a/src/chrtrans/def7_uni.tbl b/src/chrtrans/def7_uni.tbl index 66a63f76..01b86d7a 100644 --- a/src/chrtrans/def7_uni.tbl +++ b/src/chrtrans/def7_uni.tbl @@ -1754,6 +1754,7 @@ U+266e:Mx U+266f:# 0x58 U+2713 U+2717 # check marks -> x U+2720:-X +# CJK area: 0x20 U+3000 # ideographic space U+3001:,_ U+3002:._ @@ -2014,6 +2015,10 @@ U+3229:10c U+327f:KSC U+33c2:am U+33d8:pm +# end of CJK area (up to U+e000). + +# Characters in Private Use Area (e000-f8ff) do not have unassigned numbers. + U+fb00:ff U+fb01:fi U+fb02:fl @@ -2209,8 +2214,6 @@ U+009a:SC #U+009e:PM #U+009f:AC -# Characters in Private Use Area (e000-f8ff) do not have ussigned numbers. - # Let's try to show a question mark for character that cannot # be shown. U+fffd is used for invalid characters. # It works, but let's stick with UHHH representatiion. - FM diff --git a/userdefs.h b/userdefs.h index cc43f989..88a8343e 100644 --- a/userdefs.h +++ b/userdefs.h @@ -1202,7 +1202,7 @@ * the version definition with the Project Version on checkout. Just * ignore it. - kw */ /* $Format: "#define LYNX_VERSION \"$ProjectVersion$\""$ */ -#define LYNX_VERSION "2.8.1dev.7" +#define LYNX_VERSION "2.8.1dev.8" #ifndef MAXINT #define MAXINT 2147483647 /* max integer */ |