diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 1997-11-24 19:17:20 -0500 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 1997-11-24 19:17:20 -0500 |
commit | 97d3287af85e3890f03d2a48474de0d1a431b676 (patch) | |
tree | 7db3a7cebf5a3ddce7154e927a2f1d8f3a17fa8c | |
parent | e47cfd5646f55de9688ff42df3055fd9c09b503f (diff) | |
download | lynx-snapshots-97d3287af85e3890f03d2a48474de0d1a431b676.tar.gz |
snapshot of project "lynx", label v2-7-1ac_0-97
45 files changed, 1595 insertions, 401 deletions
diff --git a/CHANGES.configure b/CHANGES.configure index 5f5eda88..48473e38 100644 --- a/CHANGES.configure +++ b/CHANGES.configure @@ -1,7 +1,41 @@ +97-11-23 +-------- +* Check for existence of sys/wait.h. - PHDM +* Do not include sys/stat.h twice. - PHDM +* New autoconf-macros to check if a function is declared after including a + specific set of files. - PHDM +* Declare strstr if it is not declared by string.h. - PHDM +* Declare getgrgid and getgrnam if not declared by grp.h. - PHDM +* Provide strstr and mktime implementations, and use them if needed. - PHDM +* Always include sys/types.h in HTUtils.h. - PHDM +* define NO_GROUPS if we do not have getgroups. - PHDM +* define NEED_REMOVE also if test yields unknown. - PHDM +* define mode_t if not done by system include files. - PHDM (phdm@macqel.be) +* change CF_UNION_WAIT to use compile+link rather than compile, to ensure + that we pick up the wait-macros rather than an implied function, which + should fix configure problems on NeXT for Francisco A. Tomei Torres + <fatomei2@mail.unm.edu>. - TD +* spelling nit from Larry Virden. - TD +* add osf3.0 to special case compiler options using -g3 in place of + -O -g, from Harsh Kumar <harsh@krcl.ernet.in>. - TD +* remove redundant "-c" option from $(installbin) in makefile.in, reported + by Michael Warner <warner@wsu.edu>, for OSF/1 4.0. - TD +* if configure --srcdir is not used, comment-out rmdir's in "make distclean" + rule. - TD +* modify recent erase/clear change so that it applies only to FANCY_CURSES, + since BSD curses does not otherwise clear the screen when restoring after + popup. - TD +* modify change for boxes so this builds with BSD curses, which has no + wborder() function. - TD +* reverse ifdef for NO_SIZECHANGEHACK to USE_SIZECHANGEHACK, which is + normally off, since this code did not work with BSD 4.4 curses, SVr4 + curses, or ncurses 4.1 with xterm. (Will make a configure test if anyone + can identify a configuration that works). - TD. 97-11-12 -------- * remove options --with-lss-file and --with-cfg-file, since the corresponding - files will always be installed under $(libdir), reported by Hynek Med. - TD + files will always be installed under $(libdir), reported by Nelson Henry + Eric. - TD * modify configure script and makefile templates to permit builds with the --srcdir option, noted by Philippe De Muyter. - TD 97-11-07 diff --git a/CHANGES.new b/CHANGES.new index 93043828..84d6473d 100644 --- a/CHANGES.new +++ b/CHANGES.new @@ -7,6 +7,60 @@ platforms see also README.win-386, for some changes for auto-configure and simple curses color see also README.configure). Note that the 2.7 -> 2.7.1 changes are included here. - KW] +1997-11-23 +* integrate PHDM's patch. - TD +* Check for existence of sys/wait.h. - PHDM +* Do not include sys/stat.h twice. - PHDM +* New autoconf-macros to check if a function is declared after including a + specific set of files. - PHDM +* Declare strstr if it is not declared by string.h. - PHDM +* Declare getgrgid and getgrnam if not declared by grp.h. - PHDM +* Provide strstr and mktime implementations, and use them if needed. - PHDM +* Always include sys/types.h in HTUtils.h. - PHDM +* define NO_GROUPS if we do not have getgroups. - PHDM +* define NEED_REMOVE also if test yields unknown. - PHDM +* define mode_t if not done by system include files. - PHDM (phdm@macqel.be) +* change CF_UNION_WAIT to use compile+link rather than compile, to ensure + that we pick up the wait-macros rather than an implied function, which + should fix configure problems on NeXT for Francisco A. Tomei Torres + <fatomei2@mail.unm.edu>. - TD +* spelling nit from Larry Virden. - TD +* add osf3.0 to special case compiler options using -g3 in place of + -O -g, from Harsh Kumar <harsh@krcl.ernet.in>. - TD +* remove redundant "-c" option from $(installbin) in makefile.in, reported + by Michael Warner <warner@wsu.edu>, for OSF/1 4.0. - TD +* if configure --srcdir is not used, comment-out rmdir's in "make distclean" + rule. - TD +* modify recent erase/clear change so that it applies only to FANCY_CURSES, + since BSD curses does not otherwise clear the screen when restoring after + popup. - TD +* modify change for boxes so this builds with BSD curses, which has no + wborder() function. - TD +* reverse ifdef for NO_SIZECHANGEHACK to USE_SIZECHANGEHACK, which is + normally off, since this code did not work with BSD 4.4 curses, SVr4 + curses, or ncurses 4.1 with xterm. (Will make a configure test if anyone + can identify a configuration that works). - TD. +1997-11-21 +* Changed LYE_LINKN to LYE_LKCMD (still mapped by default to Ctrl-V; may + need to be entered twice for some systems) for invoking a prompt to + enter any Lynx keystroke command when in form text fields. - FM +1997-11-20 +* Added an LYK_CLEAR_AUTH command, mapped to underscore ('_') by default, + which clears all authorization info for the current session. This is + recommended for the situation when one leaves one's terminal but doesn't + want to end the Browser session, nor want others to be able to retrieve + protected documents with previously entered username and password info. + Note that we don't yet have a way to block access to any protected + documents which are still in cache. - FM +1997-11-19 +* Tweak of HTTP.c to ensure closing of the connection when interrupted + ('z'apped) on the first socket read. - FM +1997-11-18 +* Mods to use the explicit label "Bad HTML:" in trace messages corresponding + to BAD_HTML_USE_TRACE messages. - FM & KW +* Tweak of the restored TABLE-in-PRE block handling to deal with the + case when it's encased in a CENTER or DIV with ALIGN="center". - FM +* Changed docs/README.defines to refer to INSTALLATION file - NHE 1997-11-17 * Changed the default ASCII BOXVERT and BOXHORI definitions from '*' to to '|' and '-', and new function LYbox() for non-VMS (n)curses. - FM @@ -47,24 +101,31 @@ changes are included here. - KW] available groups. - KW * Tweaks in code for highlighting search text in anchors, to better deal with terminals in UTF-8 mode. - KW +* Mods to ignore anything past a '?' character when simplifying URL paths, + as is now more clearly specified in the Fielding URL draft. Note that + we still assume a ';' is not in fact a parameter delimiter, or won't + have a value with characters that could be misinterpretted as relative + path specs. - FM +* Increased the redirection limit to the original Lynx's value of 10, + because the HTTP/1.1 draft no longer will restrict it to 5, but instead + will leave it to the discretion of the browser (and I like 10, as a + reminder of the "good old days" :). - FM 1997-11-15 -* Mods of the TagSoup parser to restore support for the TABLE-in-PRE-block +* Mods of parsing in HTML.c to restore support for the TABLE-in-PRE-block HTML kludge described in http://ppewww.ph.gla.ac.uk/~flavell/tablejob.html, which stopped working in conjunction with the 1997-05-21 mods (see below) for treating TABLEs as DIVisions to support ALIGNment attributes in TABLE markup. The PRE-in-TABLE-block HTML kludge was not affected by those mods but works only with the TagSoup parsing mode. - FM & KW -* Added an LINKN command key in the line editor, mapped to Ctrl-V, for - invoking the F_LINK_NUM prompt when in form text fields. Ctrl-V is - still a dead key under other circumstances in the line editor. - FM 1997-11-12 * Made handling of the 'x' in hexadecimal character references (&#xH;) case insensitive, as for the "alphabetic digits" (a-f, A-F). - FM -* Added an LINKN command key in the line editor, mapped to Ctrl-V, for +* Added a LINKN command key in the line editor, mapped to Ctrl-V, for invoking the F_LINK_NUM prompt when in form text fields. Ctrl-V is still a dead key under other circumstances in the line editor. - FM * remove options --with-lss-file and --with-cfg-file, since the corresponding - files will always be installed under $(libdir), reported by Hynek Med. - TD + files will always be installed under $(libdir), reported by Nelson Henry + Eric. - TD * modify configure script and makefile templates to permit builds with the --srcdir option, noted by Philippe De Muyter. - TD 1997-11-08 @@ -76,7 +137,7 @@ changes are included here. - KW] * Mods to handle "cp-#" charset names as synonyms for "cp#", and some cp# names as synonyms for "windows-#". FM & KW 1997-11-07 -* Change of of LY_SLrefresh() in LYCurses.c as suggested by JED - FM +* Change of LY_SLrefresh() in LYCurses.c as suggested by JED - FM * add logic to make install-directories as needed. - TD * remove --disable-char-trans option (ifdef's still remain). - TD * correct type used in first compile-test for union wait. - TD diff --git a/INSTALLATION b/INSTALLATION index 8848eb1b..a21d4835 100644 --- a/INSTALLATION +++ b/INSTALLATION @@ -546,11 +546,11 @@ VI. General installation instructions build, be certain to do a "make clean" (or "make distclean" for those using auto-configure) before attempting to compile again. - If something doesn't work, or you can't get it to compile at all, or - you can't figure out what one of the defines means, read the PROBLEMS - file and *.announce files in the docs subdirectory. The docs/CHANGES* - files record the complete history of Lynx development and are an - invaluable resource for understanding how Lynx should perform. + If something doesn't work, or you can't get Lynx to even compile, or you + don't understand what one of the defines means, read the PROBLEMS file, + and the README.defines and *.announce files in the docs subdirectory. + The docs/CHANGES* files record the entire development history of Lynx + and are an invaluable resource for understanding how Lynx should perform. If you still have difficulties, send an email message to the Lynx-Dev mailing list (see the README file). Try to include pertinent information @@ -703,4 +703,4 @@ VIII. Acknowledgment Thanks to the many volunteers who offered suggestions for making this installation manual as accurate and complete as possible. --- 1997/11/14 - H. Nelson <lynx-admin@irm.nara.kindai.ac.jp> +-- 1997/11/18 - H. Nelson <lynx-admin@irm.nara.kindai.ac.jp> diff --git a/LYMessages_en.h b/LYMessages_en.h index 4e2dfab3..dae472fb 100644 --- a/LYMessages_en.h +++ b/LYMessages_en.h @@ -95,6 +95,7 @@ #define NORMAL_LINK_MESSAGE \ "(NORMAL LINK) Use right-arrow or <return> to activate." #define LINK_NOT_FOUND "The resource requested is not available at this time." +#define ENTER_LYNX_COMMAND "Enter Lynx keystroke command: " #define WWW_WAIT_MESSAGE "Getting %s" #define WWW_SKIP_MESSAGE "Skipping %s" #define WWW_USING_MESSAGE "Using %s" @@ -400,6 +401,8 @@ #define PASSWORD_PROMPT "Password: " #define USERNAME_PASSWORD_REQUIRED "lynx: Username and Password required!!!" #define PASSWORD_REQUIRED "lynx: Password required!!!" +#define CLEAR_ALL_AUTH_INFO "Clear all authorization info for this session?" +#define AUTH_INFO_CLEARED "Authorization info cleared." #define CGI_DISABLED "cgi support has been disabled by system administrator." #define CGI_NOT_COMPILED \ "Lynxcgi capabilities are not compiled into this version." diff --git a/WWW/Library/Implementation/HTAABrow.c b/WWW/Library/Implementation/HTAABrow.c index aa8a19fd..2b50ed38 100644 --- a/WWW/Library/Implementation/HTAABrow.c +++ b/WWW/Library/Implementation/HTAABrow.c @@ -1283,3 +1283,27 @@ PUBLIC BOOL HTAA_shouldRetryWithAuth ARGS5( /* Never reached */ } +/* +** This function clears all authorization information by +** invoking the free_HTAAGlobals() function, which normally +** is invoked at exit. It allows a browser command to do +** this at any time, for example, if the user is leaving +** the terminal for a period of time, but does not want +** to end the current session. - FM +*/ +PUBLIC void HTClearHTTPAuthInfo NOARGS +{ + /* + ** Need code to check cached documents against the + ** protention templates, and do something to ensure + ** that any protected documents no longer can be + ** accessed without a new retrieval. - FM + */ + + /* + ** Now free all of the authorization info, and + ** reset the free_HTAAGlobalsSet flag. - FM + */ + free_HTAAGlobals(); + free_HTAAGlobalsSet = FALSE; +} diff --git a/WWW/Library/Implementation/HTAABrow.h b/WWW/Library/Implementation/HTAABrow.h index 2674ae6b..80da3e6e 100644 --- a/WWW/Library/Implementation/HTAABrow.h +++ b/WWW/Library/Implementation/HTAABrow.h @@ -78,7 +78,7 @@ Routines for Browser Side Recording of AA Info ** ** As usual, this string is automatically freed. */ -PUBLIC char *HTAA_composeAuth PARAMS(( +extern char *HTAA_composeAuth PARAMS(( CONST char * hostname, CONST int portnumber, CONST char * docname, @@ -112,12 +112,19 @@ PUBLIC char *HTAA_composeAuth PARAMS(( ** field (in function HTAA_composeAuth()). ** NO, otherwise. */ -PUBLIC BOOL HTAA_shouldRetryWithAuth PARAMS(( +extern BOOL HTAA_shouldRetryWithAuth PARAMS(( char * start_of_headers, int length, void * handle, int soc, BOOL IsProxy)); + +/* +** Function to allow clearing of all Authorization info +** via a browser command. - FM +*/ +extern void HTClearHTTPAuthInfo NOPARAMS; + /* Enabling Gateway httpds to Forward Authorization @@ -129,10 +136,10 @@ Enabling Gateway httpds to Forward Authorization */ -PUBLIC void HTAAForwardAuth_set PARAMS(( +extern void HTAAForwardAuth_set PARAMS(( CONST char * scheme_name, CONST char * scheme_specifics)); -PUBLIC void HTAAForwardAuth_reset NOPARAMS; +extern void HTAAForwardAuth_reset NOPARAMS; /* */ diff --git a/WWW/Library/Implementation/HTAccess.c b/WWW/Library/Implementation/HTAccess.c index 879b34c9..7a4f62ea 100644 --- a/WWW/Library/Implementation/HTAccess.c +++ b/WWW/Library/Implementation/HTAccess.c @@ -431,7 +431,7 @@ PRIVATE int get_physical ARGS2( /* ** Search for gateways. */ - gateway_parameter = (char *)malloc(strlen(access) + 20); + gateway_parameter = (char *)calloc(1, (strlen(access) + 20)); if (gateway_parameter == NULL) outofmem(__FILE__, "HTLoad"); strcpy(gateway_parameter, "WWW_"); @@ -687,12 +687,15 @@ PRIVATE BOOL HTLoadDocument ARGS4( /* ** Make sure some yoyo doesn't send us 'round in circles ** with redirecting URLs that point back to themselves. - ** We'll set the HTTP/1.1 limit of 5 redirections per - ** requested URL from a user. - FM + ** We'll set the original Lynx limit of 10 redirections + ** per requested URL from a user, because the HTTP/1.1 + ** will no longer specify a restriction to 5, but will + ** leave it up to the browser's discretion, in deference + ** to MicroSoft. - FM */ - if (redirection_attempts > 5) { + if (redirection_attempts > 10) { redirection_attempts = 0; - HTAlert("Redirection limit of 5 URL's reached."); + HTAlert("Redirection limit of 10 URLs reached."); return NO; } @@ -737,8 +740,8 @@ PRIVATE BOOL HTLoadDocument ARGS4( /* ** Don't exceed the redirection_attempts limit. - FM */ - if (++redirection_attempts > 5) { - HTAlert("Redirection limit of 5 URL's reached."); + if (++redirection_attempts > 10) { + HTAlert("Redirection limit of 10 URLs reached."); redirection_attempts = 0; FREE(use_this_url_instead); return NO; @@ -1190,7 +1193,7 @@ PUBLIC BOOL HTSearch ARGS2( CONST char * p, *s, *e; /* Pointers into keywords */ char * address = NULL; BOOL result; - char * escaped = malloc((strlen(keywords)*3) + 1); + char * escaped = (char *)calloc(1, ((strlen(keywords)*3) + 1)); static CONST BOOL isAcceptable[96] = /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ @@ -1309,7 +1312,7 @@ PUBLIC HTParentAnchor * HTHomeAnchor NOARGS FILE * fp = fopen(REMOTE_POINTER, "r"); char * status; if (fp) { - my_home_document = (char*)malloc(MAX_FILE_NAME); + my_home_document = (char*)calloc(1, MAX_FILE_NAME); if (my_home_document == NULL) outofmem(__FILE__, "HTHomeAnchor"); status = fgets(my_home_document, MAX_FILE_NAME, fp); @@ -1327,8 +1330,8 @@ PUBLIC HTParentAnchor * HTHomeAnchor NOARGS FILE * fp = NULL; CONST char * home = (CONST char*)getenv("HOME"); if (home != null) { - my_home_document = (char *)malloc( - strlen(home) + 1 + strlen(PERSONAL_DEFAULT) + 1); + my_home_document = (char *)calloc(1, + (strlen(home) + 1 + strlen(PERSONAL_DEFAULT) + 1)); if (my_home_document == NULL) outofmem(__FILE__, "HTAnchorHome"); sprintf(my_home_document, "%s/%s", home, PERSONAL_DEFAULT); diff --git a/WWW/Library/Implementation/HTFTP.c b/WWW/Library/Implementation/HTFTP.c index 701490e9..615ddcee 100644 --- a/WWW/Library/Implementation/HTFTP.c +++ b/WWW/Library/Implementation/HTFTP.c @@ -160,10 +160,12 @@ extern char *personal_mail_address; /* Module-Wide Variables ** --------------------- */ -PRIVATE connection * connections = 0; /* Linked list of connections */ -PRIVATE char response_text[LINE_LENGTH+1];/* Last response from NewsHost */ -PRIVATE connection * control = NULL; /* Current connection */ +PRIVATE connection * connections = NULL;/* Linked list of connections */ +PRIVATE char response_text[LINE_LENGTH+1];/* Last response from ftp host */ +PRIVATE connection * control = NULL; /* Current connection */ PRIVATE int data_soc = -1; /* Socket for data transfer =invalid */ +PRIVATE char *user_entered_password = NULL; +PRIVATE char *last_username_and_host = NULL; #define GENERIC_SERVER 0 #define MACHTEN_SERVER 1 @@ -207,8 +209,29 @@ PRIVATE char data_buffer[DATA_BUFFER_SIZE]; /* Input data buffer */ PRIVATE char * data_read_pointer; PRIVATE char * data_write_pointer; #define NEXT_DATA_CHAR next_data_char() +PRIVATE int close_connection PARAMS(( + connection * con)); +PRIVATE void cleanup_ftp NOARGS +{ + if (control) { + if (control->socket != -1) + close_connection(control); + FREE(control); + } +} + +/* +** This function frees module globals. - FM +*/ +PRIVATE void free_FTPGlobals NOARGS +{ + FREE(user_entered_password); + FREE(last_username_and_host); + cleanup_ftp(); +} + /* PUBLIC HTMake_VMS_name() ** CONVERTS WWW name into a VMS name ** ON ENTRY: @@ -342,15 +365,6 @@ PRIVATE int close_connection ARGS1( return -1; /* very strange -- was not on list. */ } -PRIVATE void cleanup_ftp NOARGS -{ - if (control) { - if (control->socket != -1) - close_connection(control); - FREE(control); - } -} - PRIVATE char *help_message_buffer = NULL; /* global :( */ PRIVATE void init_help_message_cache NOARGS @@ -617,18 +631,24 @@ PRIVATE int get_connection ARGS2( int status; char * command; connection * con; - char * username=NULL; - char * password=NULL; - static char *user_entered_password=NULL; - static char *last_username_and_host=NULL; + char * username = NULL; + char * password = NULL; static BOOLEAN firstuse = TRUE; if (!arg) return -1; /* Bad if no name sepcified */ if (!*arg) return -1; /* Bad if name had zero length */ + if (firstuse) { + /* + ** Set up freeing at exit. - FM + */ + atexit(free_FTPGlobals); + firstuse = FALSE; + } + if (control) { /* - ** Reuse this object - kw + ** Reuse this object - KW */ if (control->socket != -1) NETCLOSE(control->socket); @@ -640,10 +660,6 @@ PRIVATE int get_connection ARGS2( con = (connection *)calloc(1, sizeof(connection)); if (con == NULL) outofmem(__FILE__, "get_connection"); - if (firstuse) { - atexit(cleanup_ftp); - firstuse = FALSE; - } } con->socket = -1; @@ -666,18 +682,20 @@ PRIVATE int get_connection ARGS2( if (*username) HTUnEscape(username); - /* if the password doesn't exist then we are going to have - * to ask the user for it. The only problem is that we - * don't want to ask for it every time, so we will store - * away in a primitive fashion. + /* + * If the password doesn't exist then we are going to have + * to ask the user for it. The only problem is that we + * don't want to ask for it every time, so we will store + * away in a primitive fashion. */ if (!password) { char tmp[256]; sprintf(tmp, "%s@%s", username, p1); - /* if the user@host is not equal to the last time through - * or user_entered_password has no data then we need - * to ask the user for the password + /* + * If the user@host is not equal to the last time through + * or user_entered_password has no data then we need + * to ask the user for the password. */ if (!last_username_and_host || strcmp(tmp, last_username_and_host) || @@ -732,9 +750,10 @@ PRIVATE int get_connection ARGS2( return status; /* Bad return */ } - if (TRACE) + if (TRACE) { fprintf(stderr, "FTP connected, socket %d control %ld\n", con->socket, (long)con); + } control = con; /* Current control connection */ /* Initialise buffering for control connection */ @@ -2001,8 +2020,10 @@ PRIVATE EntryInfo * parse_dir_entry ARGS2( len = strlen(entry); if (*first) { if (!strcmp(entry, "can not access directory .")) { - /* don't reset *first, nothing real will follow - kw */ - entry_info->display=FALSE; + /* + * Don't reset *first, nothing real will follow. - KW + */ + entry_info->display = FALSE; return(entry_info); } *first = FALSE; @@ -2527,10 +2548,10 @@ AgainForMultiNet: entry_info = parse_dir_entry(chunk->data, &first); if (entry_info->display) { - if (TRACE) - fprintf(stderr, "Adding file to BTree: %s\n", - entry_info->filename); - HTBTree_add(bt, (EntryInfo *)entry_info); + if (TRACE) + fprintf(stderr, "Adding file to BTree: %s\n", + entry_info->filename); + HTBTree_add(bt, (EntryInfo *)entry_info); } else { FREE(entry_info); } @@ -3367,3 +3388,23 @@ listen: return HT_LOADED; } } /* open_file_read */ + +/* +** This function frees any user entered password, so that +** it must be entered again for a future request. - FM +*/ +PUBLIC void HTClearFTPPassword NOARGS +{ + /* + ** Need code to check cached documents from + ** non-anonymous ftp accounts and do something + ** to ensure that they no longer can be accessed + ** without a new retrieval. - FM + */ + + /* + ** Now free the current user entered password, + ** if any. - FM + */ + FREE(user_entered_password); +} diff --git a/WWW/Library/Implementation/HTFTP.h b/WWW/Library/Implementation/HTFTP.h index 9fc4bf20..814772d4 100644 --- a/WWW/Library/Implementation/HTFTP.h +++ b/WWW/Library/Implementation/HTFTP.h @@ -57,6 +57,11 @@ extern int HTFTPLoad PARAMS HTStream* sink )); +/* +** This function frees any user entered password, so that +** it must be entered again for a future request. - FM +*/ +extern void HTClearFTPPassword NOPARAMS; /* diff --git a/WWW/Library/Implementation/HTFile.c b/WWW/Library/Implementation/HTFile.c index 6ef0fde1..ac0d2874 100644 --- a/WWW/Library/Implementation/HTFile.c +++ b/WWW/Library/Implementation/HTFile.c @@ -1124,6 +1124,15 @@ PUBLIC float HTFileValue ARGS1( ** 1. No code for non-unix systems. ** 2. Isn't there a quicker way? */ + +#if defined(HAVE_CONFIG_H) + +#ifndef HAVE_GETGROUPS +#define NO_GROUPS +#endif + +#else + #ifdef VMS #define NO_GROUPS #endif /* VMS */ @@ -1137,6 +1146,8 @@ PUBLIC float HTFileValue ARGS1( #define NO_GROUPS #endif /* PCNFS */ +#endif /* HAVE_CONFIG_H */ + PUBLIC BOOL HTEditable ARGS1( CONST char *, filename) { diff --git a/WWW/Library/Implementation/HTNews.c b/WWW/Library/Implementation/HTNews.c index bb3481d9..ff488f1f 100644 --- a/WWW/Library/Implementation/HTNews.c +++ b/WWW/Library/Implementation/HTNews.c @@ -953,15 +953,15 @@ PRIVATE int read_article NOARGS { char line[LINE_LENGTH+1]; char *full_line = NULL; - char *subject=NULL; /* Subject string */ - char *from=NULL; /* From string */ - char *replyto=NULL; /* Reply-to string */ - char *date=NULL; /* Date string */ - char *organization=NULL; /* Organization string */ - char *references=NULL; /* Hrefs for other articles */ - char *newsgroups=NULL; /* Newsgroups list */ - char *followupto=NULL; /* Followup list */ - char *href=NULL; + char *subject = NULL; /* Subject string */ + char *from = NULL; /* From string */ + char *replyto = NULL; /* Reply-to string */ + char *date = NULL; /* Date string */ + char *organization = NULL; /* Organization string */ + char *references = NULL; /* Hrefs for other articles */ + char *newsgroups = NULL; /* Newsgroups list */ + char *followupto = NULL; /* Followup list */ + char *href = NULL; char *p = line; BOOL done = NO; @@ -1009,8 +1009,11 @@ PRIVATE int read_article NOARGS StrAllocCopy(full_line, line); } - if (full_line[0] == '.') { - if ((unsigned char)full_line[1] < ' ') { /* End of article? */ + if (full_line[0] == '.') { + /* + ** End of article? + */ + if ((unsigned char)full_line[1] < ' ') { done = YES; break; } @@ -1273,7 +1276,10 @@ PRIVATE int read_article NOARGS if (TRACE) fprintf(stderr, "B %s", line); if (line[0] == '.') { - if ((unsigned char)line[1] < ' ') { /* End of article? */ + /* + ** End of article? + */ + if ((unsigned char)line[1] < ' ') { done = YES; break; } else { /* Line starts with dot */ @@ -1506,7 +1512,7 @@ PRIVATE int read_list ARGS1(char *, arg) *p++ = ch; } if (ch == LF) { - skip_rest_of_line = NO; /* done, reset flag */ + skip_rest_of_line = NO; /* done, reset flag */ *p = '\0'; /* Terminate the string */ if (TRACE) fprintf(stderr, "B %s", line); @@ -1709,7 +1715,10 @@ PRIVATE int read_group ARGS3( if (TRACE) fprintf(stderr, "X %s", line); if (line[0] == '.') { - if (line[1] < ' ') { /* End of response? */ + /* + ** End of response? + */ + if ((unsigned char)line[1] < ' ') { done = YES; break; } else { /* Line starts with dot */ @@ -1817,7 +1826,10 @@ PRIVATE int read_group ARGS3( switch(line[0]) { case '.': - done = ((unsigned char)line[1] < ' '); /* End of response? */ + /* + ** End of response? + */ + done = ((unsigned char)line[1] < ' '); break; case 'S': @@ -2778,6 +2790,29 @@ Send_NNTP_command: return HT_NOT_LOADED; } +/* +** This function clears all authorization information by +** invoking the free_HTAAGlobals() function, which normally +** is invoked at exit. It allows a browser command to do +** this at any time, for example, if the user is leaving +** the terminal for a period of time, but does not want +** to end the current session. - FM +*/ +PUBLIC void HTClearNNTPAuthInfo NOARGS +{ + /* + ** Need code to check cached documents and do + ** something to ensure that any protected + ** documents no longer can be accessed without + ** a new retrieval. - FM + */ + + /* + ** Now free all of the authorization info. - FM + */ + free_NNTP_AuthInfo(); +} + #ifdef GLOBALDEF_IS_MACRO #define _HTNEWS_C_1_INIT { "news", HTLoadNews, NULL } GLOBALDEF (HTProtocol,HTNews,_HTNEWS_C_1_INIT); diff --git a/WWW/Library/Implementation/HTNews.h b/WWW/Library/Implementation/HTNews.h index bffaeb1b..bc25fc87 100644 --- a/WWW/Library/Implementation/HTNews.h +++ b/WWW/Library/Implementation/HTNews.h @@ -31,10 +31,13 @@ GLOBALREF HTProtocol HTSNewsPost; GLOBALREF HTProtocol HTSNewsReply; #endif /* GLOBALREF_IS_MACRO */ -extern void HTSetNewsHost PARAMS((CONST char *value)); +extern void HTSetNewsHost PARAMS(( + CONST char * value)); extern CONST char * HTGetNewsHost NOPARAMS; extern char * HTNewsHost; +extern void HTClearNNTPAuthInfo NOPARAMS; + #endif /* HTNEWS_H */ diff --git a/WWW/Library/Implementation/HTParse.c b/WWW/Library/Implementation/HTParse.c index ab5149b0..129af946 100644 --- a/WWW/Library/Implementation/HTParse.c +++ b/WWW/Library/Implementation/HTParse.c @@ -174,7 +174,7 @@ PRIVATE void scan ARGS2( ** wanted A mask for the bits which are wanted. ** ** On exit, -** returns A pointer to a malloc'd string which MUST BE FREED +** returns A pointer to a calloc'd string which MUST BE FREED */ PUBLIC char * HTParse ARGS3( CONST char *, aName, @@ -198,10 +198,10 @@ PUBLIC char * HTParse ARGS3( ** Allocate the output string. */ len = strlen(aName) + strlen(relatedName) + 10; - result = (char *)malloc(len); /* Lots of space: more than enough */ - if (result == NULL) + result = (char *)calloc(1, len); /* Lots of space: more than enough */ + if (result == NULL) { outofmem(__FILE__, "HTParse"); - result[0] = '\0'; /* Clear string */ + } /* ** Make working copies of the input strings to cut up. @@ -449,8 +449,30 @@ PUBLIC void HTSimplify ARGS1( if (filename == NULL) return; - if ((filename[0] && filename[1]) && strchr(filename, '/') != NULL) { + if (!(filename[0] && filename[1]) || + filename[0] == '?' || filename[1] == '?' || filename[2] == '?') + return; + + if (strchr(filename, '/') != NULL) { for (p = (filename + 2); *p; p++) { + if (*p == '?') { + /* + ** We're still treating a ?searchpart as part of + ** the path in HTParse() and scan(), but if we + ** encounter a '?' here, assume it's the delimiter + ** and break. We also could check for a parameter + ** delimiter (';') here, but the current Fielding + ** draft (wisely or ill-advisedly :) says that it + ** should be ignored and collapsing be allowed in + ** it's value). The only defined parameter at + ** present is ;type=[A, I, or D] for ftp URLs, so + ** if there's a "/..", "/../", "/./", or terminal + ** '.' following the ';', it must be due to the + ** ';' being an unescaped path character and not + ** actually a parameter delimiter. - FM + */ + break; + } if (*p == '/') { if ((p[1] == '.') && (p[2] == '.') && (p[3] == '/' || p[3] == '\0')) { @@ -489,7 +511,7 @@ PUBLIC void HTSimplify ARGS1( } } else if (p[1] == '.' && p[2] == '/') { /* - ** Handle "./" by removing the characters. + ** Handle "/." by removing the characters. */ q = p; q1 = (p + 2); @@ -505,6 +527,48 @@ PUBLIC void HTSimplify ARGS1( } } } + if (p >= filename + 2 && *p == '?' && *(p-1) == '.') { + if (*(p-2) == '/') { + /* + ** Handle "/.?" by removing the dot. + */ + q = p - 1; + q1 = p; + while (*q1 != '\0') + *q++ = *q1++; + *q = '\0'; + } else if (*(p-2) == '.' && + p >= filename + 4 && *(p-3) == '/' && + (*(p-4) != '/' || + (p > filename + 4 && *(p-5) != ':'))) { + /* + ** Handle "xxx/..?" + */ + for (q = (p - 4); (q > filename) && (*q != '/'); q--) + /* + ** Back up to previous slash or beginning of string. + */ + ; + if (*q == '/') { + if (q > filename && *(q-1) == '/' && + !(q > filename + 1 && *(q-1) != ':')) + return; + q++; + } + if (strncmp(q, "../", 3) && strncmp(q, "./", 2)) { + /* + ** Not after "//" at beginning of string or + ** after "://", and xxx is not ".." or ".", + ** so remove the "xxx/..". + */ + q1 = p; + p = q; + while (*q1 != '\0') + *p++ = *q1++; + *p = '\0'; /* terminate */ + } + } + } } } @@ -563,7 +627,7 @@ PUBLIC char * HTRelative ARGS2( for (; *q && (*q != '#'); q++) if (*q == '/') levels++; - result = (char *)malloc(3*levels + strlen(last_slash) + 1); + result = (char *)calloc(1, (3*levels + strlen(last_slash) + 1)); if (result == NULL) outofmem(__FILE__, "HTRelative"); result[0] = '\0'; @@ -585,7 +649,7 @@ PUBLIC char * HTRelative ARGS2( ** It returns a string which has these characters ** represented by a '%' character followed by two hex digits. ** -** Unlike HTUnEscape(), this routine returns a malloced string. +** Unlike HTUnEscape(), this routine returns a calloced string. */ PRIVATE CONST unsigned char isAcceptable[96] = @@ -615,7 +679,7 @@ PUBLIC char * HTEscape ARGS2( for (p = str; *p; p++) if (!ACCEPTABLE((unsigned char)TOASCII(*p))) unacceptable++; - result = (char *) malloc(p-str + unacceptable+ unacceptable + 1); + result = (char *)calloc(1, (p-str + unacceptable + unacceptable + 1)); if (result == NULL) outofmem(__FILE__, "HTEscape"); for (q = result, p = str; *p; p++) { @@ -640,7 +704,7 @@ PUBLIC char * HTEscape ARGS2( ** represented by a '%' character followed by two hex digits, ** except that spaces are converted to '+' instead of %2B. ** -** Unlike HTUnEscape(), this routine returns a malloced string. +** Unlike HTUnEscape(), this routine returns a calloced string. */ PUBLIC char * HTEscapeSP ARGS2( CONST char *, str, @@ -653,7 +717,7 @@ PUBLIC char * HTEscapeSP ARGS2( for (p = str; *p; p++) if (!(*p == ' ' || ACCEPTABLE((unsigned char)TOASCII(*p)))) unacceptable++; - result = (char *) malloc(p-str + unacceptable+ unacceptable + 1); + result = (char *)calloc(1, (p-str + unacceptable + unacceptable + 1)); if (result == NULL) outofmem(__FILE__, "HTEscape"); for (q = result, p = str; *p; p++) { @@ -800,7 +864,7 @@ PUBLIC void HTMake822Word ARGS1( } if (!added) return; - result = (char *) malloc(p-(*str) + added + 1); + result = (char *)calloc(1, (p-(*str) + added + 1)); if (result == NULL) outofmem(__FILE__, "HTMake822Word"); result[0] = '"'; diff --git a/WWW/Library/Implementation/HTPlain.c b/WWW/Library/Implementation/HTPlain.c index 277a6ebf..824ac642 100644 --- a/WWW/Library/Implementation/HTPlain.c +++ b/WWW/Library/Implementation/HTPlain.c @@ -390,22 +390,6 @@ PRIVATE void HTPlain_write ARGS3(HTStream *, me, CONST char*, s, int, l) */ } else if (code == 8211 || code == 8212) { HText_appendCharacter(me->text, '-'); - /* - ** Ignore 8204 (zwnj) or 8205 (zwj), for now. - FM - */ - } else if (code == 8204 || code == 8205) { - if (TRACE) { - fprintf(stderr, - "HTPlain_write: Ignoring '%ld'.\n", code); - } - /* - ** Ignore 8206 (lrm) or 8207 (rlm), for now. - FM - */ - } else if (code == 8206 || code == 8207) { - if (TRACE) { - fprintf(stderr, - "HTPlain_write: Ignoring '%ld'.\n", code); - } #endif /* NOTUSED_FOTEMODS */ /****************************************************************** @@ -460,6 +444,51 @@ PRIVATE void HTPlain_write ARGS3(HTStream *, me, CONST char*, s, int, l) ** (somewhat) readable ASCII. */ HText_appendCharacter(me->text, (char)(*p & 0x7f)); +#ifdef NOTUSED_FOTEMODS + /* + ** If we do not have the "7-bit approximations" as our + ** output character set (in which case we did it already) + ** seek a translation for that. Otherwise, or if the + ** translation fails, use UHHH notation. - FM + */ + } else if (chk && + (chk = (!HTPassEightBitRaw && + (me->htext_char_set != + UCGetLYhndl_byMIME("us-ascii")))) && + (uck = UCTransUniChar(code, + UCGetLYhndl_byMIME("us-ascii"))) + >= 32 && uck < 127) { + /* + ** Got an ASCII character (yippey). - FM + */ + c = ((char)(uck & 0xff)); + HText_appendCharacter(me->text, c); + } else if ((chk && uck == -4) && + (uck = UCTransUniCharStr(replace_buf, + 60, code, + UCGetLYhndl_byMIME("us-ascii"), + 0) >= 0)) { + /* + ** Got a repacement string (yippey). - FM + */ + HText_appendText(me->text, replace_buf); + } else if (code == 8204 || code == 8205) { + /* + ** Ignore 8204 (zwnj) or 8205 (zwj), if we get to here. - FM + */ + if (TRACE) { + fprintf(stderr, + "HTPlain_write: Ignoring '%ld'.\n", code); + } + } else if (code == 8206 || code == 8207) { + /* + ** Ignore 8206 (lrm) or 8207 (rlm), if we get to here. - FM + */ + if (TRACE) { + fprintf(stderr, + "HTPlain_write: Ignoring '%ld'.\n", code); + } +#endif /* NOTUSED_FOTEMODS */ } else if (me->T.trans_from_uni && code > 255) { if (PASSHI8BIT && PASSHICTRL && LYRawMode && (unsigned char)*p >= LYlowest_eightbit[me->htext_char_set]) { diff --git a/WWW/Library/Implementation/HTTCP.c b/WWW/Library/Implementation/HTTCP.c index 572cd36b..cbc43984 100644 --- a/WWW/Library/Implementation/HTTCP.c +++ b/WWW/Library/Implementation/HTTCP.c @@ -346,15 +346,15 @@ PUBLIC int HTParseInet ARGS2( if (port[0] >= '0' && port[0] <= '9') { #ifdef unix sin->sin_port = htons(atol(port)); -#else /* VMS */ +#else /* VMS: */ #ifdef DECNET - sin->sdn_objnum = (unsigned char) (strtol(port, (char**)0 , 10)); + sin->sdn_objnum = (unsigned char)(strtol(port, (char**)0, 10)); #else - sin->sin_port = htons((unsigned short) strtol(port,(char**)0,10)); + sin->sin_port = htons((unsigned short)strtol(port,(char**)0,10)); #endif /* Decnet */ #endif /* Unix vs. VMS */ - } else { #ifdef SUPPRESS /* 1. crashes!?!. 2. Not recommended */ + } else { struct servent * serv = getservbyname(port, (char*)0); if (serv) { sin->sin_port = serv->s_port; @@ -371,25 +371,27 @@ PUBLIC int HTParseInet ARGS2( ** it's probably worth waiting until the Phase transition from IV to V. */ sin->sdn_nam.n_len = min(DN_MAXNAML, strlen(host)); /* <=6 in phase 4 */ - strncpy (sin->sdn_nam.n_name, host, sin->sdn_nam.n_len + 1); + strncpy(sin->sdn_nam.n_name, host, sin->sdn_nam.n_len + 1); if (TRACE) { fprintf(stderr, "DECnet: Parsed address as object number %d on host %.6s...\n", sin->sdn_objnum, host); } -#else /* parse Internet host */ +#else /* parse Internet host: */ if (*host >= '0' && *host <= '9') { /* Test for numeric node address: */ char *strptr = host; while (*strptr) { - if (*strptr == '.') + if (*strptr == '.') { dotcount_ip++; - else if (!isdigit(*strptr)) + } else if (!isdigit(*strptr)) { break; + } strptr++; } - if (*strptr) /* found non-numeric, assume domain name */ + if (*strptr) { /* found non-numeric, assume domain name */ dotcount_ip = 0; + } } /* @@ -733,7 +735,7 @@ PUBLIC int HTDoConnect ARGS4( } FREE(p1); - line = (char *)malloc(strlen(host) + strlen(protocol) + 128); + line = (char *)calloc(1, (strlen(host) + strlen(protocol) + 128)); if (line == NULL) outofmem(__FILE__, "HTDoConnect"); sprintf (line, "Looking up %s.", host); diff --git a/WWW/Library/Implementation/HTTP.c b/WWW/Library/Implementation/HTTP.c index 595f39bd..fc279af6 100644 --- a/WWW/Library/Implementation/HTTP.c +++ b/WWW/Library/Implementation/HTTP.c @@ -690,7 +690,8 @@ try_again: if (TRACE) fprintf (stderr, "HTTP: Interrupted initial read.\n"); _HTProgress ("Connection interrupted."); - status = HT_INTERRUPTED; + HTTP_NETCLOSE(s, handle); + status = HT_NO_DATA; goto clean_up; } else if (status < 0 && (SOCKET_ERRNO == ENOTCONN || diff --git a/WWW/Library/Implementation/HTUtils.h b/WWW/Library/Implementation/HTUtils.h index ec7265fb..458b8171 100644 --- a/WWW/Library/Implementation/HTUtils.h +++ b/WWW/Library/Implementation/HTUtils.h @@ -16,6 +16,7 @@ #ifdef HAVE_CONFIG_H #include <lynx_cfg.h> /* generated by autoconf 'configure' script */ +#include <sys/types.h> #else /* Explicit system-configure */ diff --git a/WWW/Library/Implementation/SGML.c b/WWW/Library/Implementation/SGML.c index 4af1fab9..b38a7dad 100644 --- a/WWW/Library/Implementation/SGML.c +++ b/WWW/Library/Implementation/SGML.c @@ -44,7 +44,8 @@ PUBLIC BOOL HTPassEightBitNum = FALSE; /* Pass ^ numeric entities raw. */ PUBLIC BOOL HTPassHighCtrlRaw = FALSE; /* Pass 127-160,173, raw. */ PUBLIC BOOL HTPassHighCtrlNum = FALSE; /* Pass €-Ÿ raw. */ -extern UCode_t HTMLGetEntityUCValue PARAMS((CONST char *name)); +extern UCode_t HTMLGetEntityUCValue PARAMS(( + CONST char * name)); extern int LYlowest_eightbit[]; /* The State (context) of the parser @@ -323,23 +324,6 @@ PRIVATE BOOL put_special_unicodes ARGS2( ** Use ASCII hyphen for ndash/endash or mdash/emdash. */ PUTC('-'); -#ifdef NOTUSED_FOTEMODS - } else if (code == 8204 || code == 8205) { - /* - ** Ignore zwnj or zwj, for now. Note that zwnj may have - ** been handled as <WBR> by the calling function. - FM - */ - if (TRACE) { - fprintf(stderr, "put_special_unicodes: Ignoring '%ld'.\n", code); - } - } else if (code == 8206 || code == 8207) { - /* - ** Ignore lrm or rlm, for now. - */ - if (TRACE) { - fprintf(stderr, "put_special_unicodes: Ignoring '%ld'.\n", code); - } -#endif /* NOTUSED_FOTEMODS */ } else { /* ** Return NO if nothing done. @@ -422,32 +406,6 @@ PRIVATE void handle_entity ARGS2( FoundEntity = TRUE; return; } - - /* - ** Ignore zwnj (8204) and zwj (8205), for now. - ** Note that zwnj may have been handled as <WBR> - ** by the calling function. - FM - */ - if (!strcmp(s, "zwnj") || - !strcmp(s, "zwnj")) { - if (TRACE) { - fprintf(stderr, "handle_entity: Ignoring '%s'.\n", s); - } - FoundEntity = TRUE; - return; - } - - /* - ** Ignore lrm (8206), and rln (8207), for now. - FM - */ - if (!strcmp(s, "lrm") || - !strcmp(s, "rlm")) { - if (TRACE) { - fprintf(stderr, "handle_entity: Ignoring '%s'.\n", s); - } - FoundEntity = TRUE; - return; - } #endif /* NOTUSED_FOTEMODS */ /* @@ -517,6 +475,33 @@ PRIVATE void handle_entity ARGS2( return; } } +#ifdef NOTUSED_FOTEMODS + /* + ** Ignore zwnj (8204) and zwj (8205), if we get to here. + ** Note that zwnj may have been handled as <WBR> + ** by the calling function. - FM + */ + if (!strcmp(s, "zwnj") || + !strcmp(s, "zwj")) { + if (TRACE) { + fprintf(stderr, "handle_entity: Ignoring '%s'.\n", s); + } + FoundEntity = TRUE; + return; + } + + /* + ** Ignore lrm (8206), and rlm (8207), if we get to here. - FM + */ + if (!strcmp(s, "lrm") || + !strcmp(s, "rlm")) { + if (TRACE) { + fprintf(stderr, "handle_entity: Ignoring '%s'.\n", s); + } + FoundEntity = TRUE; + return; + } +#endif /* NOTUSED_FOTEMODS */ /* ** We haven't succeeded yet, so try the old LYCharSets @@ -1770,6 +1755,133 @@ top1: HTChunkTerminate(string); if ((context->isHex ? sscanf(string->data, "%x", &value) : sscanf(string->data, "%d", &value)) == 1) { +#ifdef NOTUSED_FOTEMODS + if ((code == 1) || + (code > 129 && code < 156)) { + /* + ** Assume these are MicroSoft code points, + ** inflicted on us by FrontPage. - FM + */ + switch (code) { + case 1: + /* + ** WHITE SMILING FACE + */ + code = 0x263a; + break; + case 130: + /* + ** SINGLE LOW-9 QUOTATION MARK (sbquo) + */ + code = 0x201a; + break; + case 132: + /* + ** DOUBLE LOW-9 QUOTATION MARK (bdquo) + */ + code = 0x201e; + break; + case 133: + /* + ** HORIZONTAL ELLIPSIS (hellip) + */ + code = 0x2026; + break; + case 134: + /* + ** DAGGER (dagger) + */ + code = 0x2020; + break; + case 135: + /* + ** DOUBLE DAGGER (Dagger) + */ + code = 0x2021; + break; + case 137: + /* + ** PER MILLE SIGN (permil) + */ + code = 0x2030; + break; + case 139: + /* + ** SINGLE LEFT-POINTING ANGLE QUOTATION MARK + ** (lsaquo) + */ + code = 0x2039; + break; + case 145: + /* + ** LEFT SINGLE QUOTATION MARK (lsquo) + */ + code = 0x2018; + break; + case 146: + /* + ** RIGHT SINGLE QUOTATION MARK (rsquo) + */ + code = 0x2019; + break; + case 147: + /* + ** LEFT DOUBLE QUOTATION MARK (ldquo) + */ + code = 0x201c; + break; + case 148: + /* + ** RIGHT DOUBLE QUOTATION MARK (rdquo) + */ + code = 0x201d; + break; + case 149: + /* + ** BULLET (bull) + */ + code = 0x2022; + break; + case 150: + /* + ** EN DASH (ndash) + */ + code = 0x2013; + break; + case 151: + /* + ** EM DASH (mdash) + */ + code = 0x2014; + break; + case 152: + /* + ** SMALL TILDE (tilde) + */ + code = 0x02dc; + break; + case 153: + /* + ** TRADE MARK SIGN (trade) + */ + code = 0x2122; + break; + case 155: + /* + ** SINGLE RIGHT-POINTING ANGLE QUOTATION MARK + ** (rsaquo) + */ + code = 0x203a; + break; + default: + /* + ** Do not attempt a conversion + ** to valid Unicode values. + */ + break; + } + } +#endif /* NOTUSED_FOTEMODS */ /* ** Check for special values. - FM */ @@ -1911,6 +2023,25 @@ top1: */ for (p = replace_buf; *p; p++) PUTC(*p); + /* + ** Ignore 8205 (zwj), + ** 8206 (lrm), and 8207 (rln), if we get to here. - FM + */ + } else if (code == 8205 || + code == 8206 || + code == 8207) { + if (TRACE) { + fprintf(stderr, + "SGML_character: Ignoring '%s%s'.\n", + (context->isHex ? "&#x" : "&#"), + string->data); + } + string->size = 0; + context->isHex = FALSE; + context->state = S_text; + if (c != ';') + goto top1; + break; #endif /* NOTUSED_FOTEMODS */ /* ** Show the numeric entity if we get to here diff --git a/aclocal.m4 b/aclocal.m4 index 8c7fbf5f..4db8eaf9 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,9 +1,10 @@ dnl Macros for auto-configure script. dnl by T.E.Dickey <dickey@clark.net> dnl and Jim Spath <jspath@mail.bcpl.lib.md.us> +dnl and Philippe De Muyter <phdm@macqel.be> dnl dnl Created: 1997/1/28 -dnl Updated: 1997/8/28 +dnl Updated: 1997/11/23 dnl dnl --------------------------------------------------------------------------- dnl --------------------------------------------------------------------------- @@ -136,6 +137,42 @@ if test "$cf_cv_bool_defs" = no ; then fi ])dnl dnl --------------------------------------------------------------------------- +dnl Check if a function is declared by including a set of include files. +dnl Invoke the corresponding actions according to whether it is found or not. +dnl CF_CHECK_FUNCDECL(INCLUDES, FUNCTION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +AC_DEFUN(CF_CHECK_FUNCDECL, +[AC_MSG_CHECKING([for $2 declaration]) +AC_CACHE_VAL(ac_cv_func_decl_$2, +[AC_TRY_COMPILE([$1], +[#ifndef ${ac_func} +int (*p)() = ${ac_func}; +#endif], +eval "ac_cv_func_decl_$2=yes", eval "ac_cv_func_decl_$2=no")])dnl +if eval "test \"`echo '$ac_cv_func_'decl_$2`\" = yes"; then + AC_MSG_RESULT(yes) + ifelse([$3], , :, [$3]) +else + AC_MSG_RESULT(no) +ifelse([$4], , , [$4 +])dnl +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl Check if functions are declared by including a set of include files. +dnl and define DECL_XXX if not. +dnl +dnl CF_CHECK_FUNCDECLS(INCLUDES, FUNCTION... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +AC_DEFUN(CF_CHECK_FUNCDECLS, +[for ac_func in $2 +do +CF_CHECK_FUNCDECL([$1], $ac_func, +[$3], +[ + CF_UPPER(ac_tr_func,DECL_$ac_func) + AC_DEFINE_UNQUOTED($ac_tr_func) $4])dnl +done +])dnl +dnl --------------------------------------------------------------------------- dnl Check if curses supports color. (Note that while SVr3 curses supports dnl color, it does this differently from SVr4 curses; more work would be needed dnl to accommodate SVr3). @@ -923,7 +960,7 @@ AC_TRY_LINK( ]) ]) AC_MSG_RESULT($cf_cv_baddef_remove) -test "$cf_cv_baddef_remove" = yes && AC_DEFINE(NEED_REMOVE) +test "$cf_cv_baddef_remove" != no && AC_DEFINE(NEED_REMOVE) ])dnl dnl --------------------------------------------------------------------------- dnl Check for definitions & structures needed for window size-changing @@ -1169,15 +1206,16 @@ AC_DEFUN([CF_UNION_WAIT], AC_REQUIRE([CF_WAIT_HEADERS]) AC_MSG_CHECKING([for union wait]) AC_CACHE_VAL(cf_cv_type_unionwait,[ - AC_TRY_COMPILE($cf_wait_headers, + AC_TRY_LINK($cf_wait_headers, [int x; int y = WEXITSTATUS(x); int z = WTERMSIG(x); + wait(&x); ], [cf_cv_type_unionwait=no echo compiles ok w/o union wait 1>&AC_FD_CC ],[ - AC_TRY_COMPILE($cf_wait_headers, + AC_TRY_LINK($cf_wait_headers, [union wait x; #ifdef WEXITSTATUS int y = WEXITSTATUS(x); @@ -1185,6 +1223,7 @@ AC_CACHE_VAL(cf_cv_type_unionwait,[ #ifdef WTERMSIG int z = WTERMSIG(x); #endif + wait(&x); ], [cf_cv_type_unionwait=yes echo compiles ok with union wait and possibly macros too 1>&AC_FD_CC diff --git a/config.hin b/config.hin index 9a17c6ef..3653bad7 100644 --- a/config.hin +++ b/config.hin @@ -10,6 +10,9 @@ #undef COPY_PATH /* CF_PATH_PROG(cp) */ #undef CURS_PERFORMANCE /* CF_CURS_PERFORMANCE */ #undef DEBUG /* configure --enable-debug */ +#undef DECL_GETGRGID +#undef DECL_GETGRNAM +#undef DECL_STRSTR #undef DECL_SYS_ERRLIST #undef DIRED_SUPPORT /* AC_ARG_WITH(dired) */ #undef EXP_CHARTRANS /* AC_ARG_WITH(char-trans) */ @@ -21,6 +24,7 @@ #undef HAVE_FCNTL_H /* have <fcntl.h> */ #undef HAVE_GETBKGD /* defined by CF_COLOR_CURSES */ #undef HAVE_GETCWD +#undef HAVE_GETGROUPS #undef HAVE_KEYPAD #undef HAVE_LIMITS_H #undef HAVE_NCURSES_H /* defined if we include <ncurses.h> */ @@ -33,6 +37,7 @@ #undef HAVE_SYS_FILIO_H /* have <sys/filio.h> */ #undef HAVE_SYS_IOCTL_H /* have <sys/ioctl.h> */ #undef HAVE_SYS_NDIR_H /* defined by AC_HEADER_DIRENT */ +#undef HAVE_SYS_WAIT_H /* have <sys/wait.h> */ #undef HAVE_TERMIOS_H /* have <termios.h> */ #undef HAVE_TTYTYPE #undef HAVE_TYPE_UNIONWAIT /* CF_UNION_WAIT */ @@ -76,6 +81,7 @@ #undef UNZIP_PATH /* CF_PATH_PROG(unzip) */ #undef USE_COLOR_STYLE /* CF_ARG_ENABLE(color-style) */ #undef USE_HASH /* see USE_COLOR_STYLE */ +#undef USE_SIZECHANGEHACK /* FIXME: find a case where this works! */ #undef USE_SLANG /* AC_ARG_WITH(screen=slang) */ #undef USE_ZLIB /* AC_ARG_WITH(zlib) */ #undef UTMPX_FOR_UTMP /* use <utmpx.h> since <utmp.h> not found */ @@ -85,6 +91,7 @@ #undef ZCAT_PATH /* CF_PATH_PROG(zcat) */ #undef ZIP_PATH /* CF_PATH_PROG(zip) */ #undef const /* defined by AC_C_CONST */ +#undef mode_t /* defined by AC_TYPE_MODE_T */ #undef vfork /* defined by AC_FUNC_FORK */ /* FIXME:ALLOW_USERS_TO_CHANGE_EXEC_WITHIN_OPTIONS */ /* FIXME:BSDI */ @@ -104,4 +111,16 @@ /* FIXME:SVR4_BSDSELECT */ /* FIXME:SYSLOG_REQUESTED_URLS */ +#ifdef DECL_GETGRGID +extern struct group * getgrgid (); +#endif + +#ifdef DECL_GETGRNAM +extern struct group * getgrnam (); +#endif + +#ifdef DECL_STRSTR +extern char * strstr (); +#endif + #endif /* LYNX_CFG_H */ diff --git a/configure b/configure index 49a96473..c054152b 100755 --- a/configure +++ b/configure @@ -1137,7 +1137,7 @@ fi echo "$ac_t""$with_debug" 1>&6 if test "$with_debug" = "yes" ; then case $host_os in - ultrix*|osf4.*) + ultrix*|osf34.*) CFLAGS=`echo ${CFLAGS} | sed -e 's/-O[1-9]\? //' -e 's/-O[1-9]\?$//'` @@ -5498,10 +5498,11 @@ int main() { int x; int y = WEXITSTATUS(x); int z = WTERMSIG(x); + wait(&x); ; return 0; } EOF -if { (eval echo configure:5505: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5506: \"$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 @@ -5512,7 +5513,7 @@ else rm -rf conftest* cat > conftest.$ac_ext <<EOF -#line 5516 "configure" +#line 5517 "configure" #include "confdefs.h" $cf_wait_headers int main() { @@ -5523,10 +5524,11 @@ union wait x; #ifdef WTERMSIG int z = WTERMSIG(x); #endif + wait(&x); ; return 0; } EOF -if { (eval echo configure:5530: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5532: \"$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 @@ -5553,20 +5555,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:5557: checking if union wait can be used as wait-arg" >&5 +echo "configure:5559: 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 5563 "configure" +#line 5565 "configure" #include "confdefs.h" $cf_wait_headers int main() { union wait x; wait(&x) ; return 0; } EOF -if { (eval echo configure:5570: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5572: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_arg_union_wait=yes else @@ -5586,20 +5588,20 @@ EOF echo $ac_n "checking if union wait can be used as waitpid-arg""... $ac_c" 1>&6 -echo "configure:5590: checking if union wait can be used as waitpid-arg" >&5 +echo "configure:5592: 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 5596 "configure" +#line 5598 "configure" #include "confdefs.h" $cf_wait_headers int main() { union wait x; waitpid(0, &x, 0) ; return 0; } EOF -if { (eval echo configure:5603: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5605: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_arg_union_waitpid=yes else @@ -5620,15 +5622,48 @@ EOF fi +echo $ac_n "checking for mode_t""... $ac_c" 1>&6 +echo "configure:5627: 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 5632 "configure" +#include "confdefs.h" +#include <sys/types.h> +#if STDC_HEADERS +#include <stdlib.h> +#include <stddef.h> +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_mode_t=yes +else + rm -rf conftest* + ac_cv_type_mode_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_mode_t" 1>&6 +if test $ac_cv_type_mode_t = no; then + cat >> confdefs.h <<\EOF +#define mode_t int +EOF + +fi + echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:5627: checking for pid_t" >&5 +echo "configure:5662: 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 5632 "configure" +#line 5667 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -5657,17 +5692,17 @@ fi ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:5661: checking for vfork.h" >&5 +echo "configure:5696: 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 5666 "configure" +#line 5701 "configure" #include "confdefs.h" #include <vfork.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5671: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5706: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5692,18 +5727,18 @@ else fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:5696: checking for working vfork" >&5 +echo "configure:5731: 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:5702: checking for vfork" >&5 +echo "configure:5737: 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 5707 "configure" +#line 5742 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char vfork(); below. */ @@ -5726,7 +5761,7 @@ vfork(); ; return 0; } EOF -if { (eval echo configure:5730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_vfork=yes" else @@ -5747,7 +5782,7 @@ fi else cat > conftest.$ac_ext <<EOF -#line 5751 "configure" +#line 5786 "configure" #include "confdefs.h" /* Thanks to Paul Eggert for this test. */ #include <stdio.h> @@ -5842,7 +5877,7 @@ main() { } } EOF -if { (eval echo configure:5846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5881: \"$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 @@ -5866,20 +5901,20 @@ fi echo $ac_n "checking for broken/missing definition of remove""... $ac_c" 1>&6 -echo "configure:5870: checking for broken/missing definition of remove" >&5 +echo "configure:5905: 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 5876 "configure" +#line 5911 "configure" #include "confdefs.h" #include <stdio.h> int main() { remove("dummy") ; return 0; } EOF -if { (eval echo configure:5883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cf_cv_baddef_remove=no else @@ -5887,7 +5922,7 @@ else cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext <<EOF -#line 5891 "configure" +#line 5926 "configure" #include "confdefs.h" #include <stdio.h> int __unlink(name) { return unlink(name); } @@ -5895,7 +5930,7 @@ int main() { remove("dummy") ; return 0; } EOF -if { (eval echo configure:5899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cf_cv_baddef_remove=yes else @@ -5912,7 +5947,7 @@ rm -f conftest* fi echo "$ac_t""$cf_cv_baddef_remove" 1>&6 -test "$cf_cv_baddef_remove" = yes && cat >> confdefs.h <<\EOF +test "$cf_cv_baddef_remove" != no && cat >> confdefs.h <<\EOF #define NEED_REMOVE 1 EOF @@ -5920,18 +5955,19 @@ EOF for ac_func in \ cuserid \ getcwd \ + getgroups \ putenv \ readdir \ waitpid \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5930: checking for $ac_func" >&5 +echo "configure:5966: 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 5935 "configure" +#line 5971 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -5954,7 +5990,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:5958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5978,17 +6014,166 @@ else fi done +for ac_func in \ + mktime \ + strstr \ + +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:6024: 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 6029 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:6052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <<EOF +#define $ac_tr_func 1 +EOF + +else + echo "$ac_t""no" 1>&6 +LIBOBJS="$LIBOBJS ${ac_func}.o" +fi +done + + + +for ac_func in strstr +do +echo $ac_n "checking for $ac_func declaration""... $ac_c" 1>&6 +echo "configure:6082: 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 6087 "configure" +#include "confdefs.h" +#include <string.h> +int main() { +#ifndef ${ac_func} +int (*p)() = ${ac_func}; +#endif +; return 0; } +EOF +if { (eval echo configure:6096: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_func_decl_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_decl_$ac_func=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_func_'decl_$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 + + +ac_tr_func=`echo DECL_$ac_func | tr '[a-z]' '[A-Z]'` + + cat >> confdefs.h <<EOF +#define $ac_tr_func 1 +EOF + +fi +done + +for ac_func in getgrgid getgrnam +do +echo $ac_n "checking for $ac_func declaration""... $ac_c" 1>&6 +echo "configure:6126: 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 6131 "configure" +#include "confdefs.h" +#include <grp.h> +int main() { +#ifndef ${ac_func} +int (*p)() = ${ac_func}; +#endif +; return 0; } +EOF +if { (eval echo configure:6140: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_func_decl_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_decl_$ac_func=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_func_'decl_$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 + + +ac_tr_func=`echo DECL_$ac_func | tr '[a-z]' '[A-Z]'` + + cat >> confdefs.h <<EOF +#define $ac_tr_func 1 +EOF + +fi +done + echo $ac_n "checking if TRUE/FALSE are defined""... $ac_c" 1>&6 -echo "configure:5986: checking if TRUE/FALSE are defined" >&5 +echo "configure:6171: 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 5992 "configure" +#line 6177 "configure" #include "confdefs.h" #include <$cf_cv_ncurses_header> @@ -5997,7 +6182,7 @@ int main() { int x = TRUE, y = FALSE ; return 0; } EOF -if { (eval echo configure:6001: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6186: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_bool_defs=yes else @@ -6023,13 +6208,13 @@ fi echo $ac_n "checking for errno external decl""... $ac_c" 1>&6 -echo "configure:6027: checking for errno external decl" >&5 +echo "configure:6212: checking for errno external decl" >&5 if eval "test \"`echo '$''{'cf_cv_extern_errno'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6033 "configure" +#line 6218 "configure" #include "confdefs.h" #include <errno.h> @@ -6037,7 +6222,7 @@ int main() { int x = errno ; return 0; } EOF -if { (eval echo configure:6041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6226: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_extern_errno=yes else @@ -6057,20 +6242,20 @@ EOF echo $ac_n "checking for setlocale()""... $ac_c" 1>&6 -echo "configure:6061: checking for setlocale()" >&5 +echo "configure:6246: 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 6067 "configure" +#line 6252 "configure" #include "confdefs.h" #include <locale.h> int main() { setlocale(LC_ALL, "") ; return 0; } EOF -if { (eval echo configure:6074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6259: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cf_cv_locale=yes else @@ -6091,13 +6276,13 @@ EOF echo $ac_n "checking if NGROUPS is defined""... $ac_c" 1>&6 -echo "configure:6095: checking if NGROUPS is defined" >&5 +echo "configure:6280: 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 6101 "configure" +#line 6286 "configure" #include "confdefs.h" #if HAVE_SYS_PARAM_H @@ -6111,7 +6296,7 @@ int main() { int x = NGROUPS ; return 0; } EOF -if { (eval echo configure:6115: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6300: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_ngroups=yes else @@ -6119,7 +6304,7 @@ else cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext <<EOF -#line 6123 "configure" +#line 6308 "configure" #include "confdefs.h" #if HAVE_SYS_PARAM_H @@ -6133,7 +6318,7 @@ int main() { int x = NGROUPS_MAX ; return 0; } EOF -if { (eval echo configure:6137: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6322: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_ngroups=NGROUPS_MAX else @@ -6164,13 +6349,13 @@ fi echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6 -echo "configure:6168: checking declaration of sys_errlist" >&5 +echo "configure:6353: checking declaration of sys_errlist" >&5 if eval "test \"`echo '$''{'cf_cv_dcl_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6174 "configure" +#line 6359 "configure" #include "confdefs.h" #include <stdio.h> @@ -6180,7 +6365,7 @@ int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:6184: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6369: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_dcl_sys_errlist=yes else @@ -6201,20 +6386,20 @@ if test $cf_cv_dcl_sys_errlist = no ; then EOF echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6 -echo "configure:6205: checking existence of sys_errlist" >&5 +echo "configure:6390: checking existence of sys_errlist" >&5 if eval "test \"`echo '$''{'cf_cv_have_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6211 "configure" +#line 6396 "configure" #include "confdefs.h" #include <errno.h> int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:6218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cf_cv_have_sys_errlist=yes else @@ -6231,13 +6416,13 @@ fi echo $ac_n "checking if struct utmp is declared""... $ac_c" 1>&6 -echo "configure:6235: checking if struct utmp is declared" >&5 +echo "configure:6420: 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 6241 "configure" +#line 6426 "configure" #include "confdefs.h" #include <sys/types.h> @@ -6246,7 +6431,7 @@ int main() { struct utmp x; char *y = &x.ut_host[0] ; return 0; } EOF -if { (eval echo configure:6250: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6435: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_have_utmp=yes else @@ -6254,14 +6439,14 @@ else cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext <<EOF -#line 6258 "configure" +#line 6443 "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:6265: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6450: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_have_utmp=utmpx else @@ -6292,13 +6477,13 @@ EOF if test $cf_cv_screen != slang ; then echo $ac_n "checking if curses supports alternate-character set""... $ac_c" 1>&6 -echo "configure:6296: checking if curses supports alternate-character set" >&5 +echo "configure:6481: 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 cat > conftest.$ac_ext <<EOF -#line 6302 "configure" +#line 6487 "configure" #include "confdefs.h" #include <$cf_cv_ncurses_header> @@ -6307,7 +6492,7 @@ int main() { chtype x = acs_map['l']; acs_map['m'] = 0 ; return 0; } EOF -if { (eval echo configure:6311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cf_cv_alt_char_set=yes else @@ -6327,13 +6512,13 @@ EOF echo $ac_n "checking if curses supports fancy attributes""... $ac_c" 1>&6 -echo "configure:6331: checking if curses supports fancy attributes" >&5 +echo "configure:6516: 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 6337 "configure" +#line 6522 "configure" #include "confdefs.h" #include <$cf_cv_ncurses_header> @@ -6346,7 +6531,7 @@ attrset(A_UNDERLINE|A_BOLD|A_REVERSE); ; return 0; } EOF -if { (eval echo configure:6350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cf_cv_fancy_curses=yes else @@ -6366,7 +6551,7 @@ EOF echo $ac_n "checking for ncurses version""... $ac_c" 1>&6 -echo "configure:6370: checking for ncurses version" >&5 +echo "configure:6555: 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 @@ -6391,7 +6576,7 @@ Autoconf "old" #endif EOF cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out" - { (eval echo configure:6395: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; } + { (eval echo configure:6580: \"$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" @@ -6400,7 +6585,7 @@ EOF else cat > conftest.$ac_ext <<EOF -#line 6404 "configure" +#line 6589 "configure" #include "confdefs.h" #include <$cf_cv_ncurses_header> @@ -6423,7 +6608,7 @@ int main() exit(0); } EOF -if { (eval echo configure:6427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6612: \"$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` @@ -6443,13 +6628,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:6447: checking for obsolete/broken version of ncurses" >&5 +echo "configure:6632: 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 6453 "configure" +#line 6638 "configure" #include "confdefs.h" #include <$cf_cv_ncurses_header> @@ -6463,7 +6648,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:6467: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6652: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_ncurses_broken=no else @@ -6488,13 +6673,13 @@ fi echo $ac_n "checking if curses supports color attributes""... $ac_c" 1>&6 -echo "configure:6492: checking if curses supports color attributes" >&5 +echo "configure:6677: 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 6498 "configure" +#line 6683 "configure" #include "confdefs.h" #include <$cf_cv_ncurses_header> @@ -6509,7 +6694,7 @@ chtype x = COLOR_BLUE; ; return 0; } EOF -if { (eval echo configure:6513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cf_cv_color_curses=yes else @@ -6536,7 +6721,7 @@ fi echo $ac_n "checking declaration of size-change""... $ac_c" 1>&6 -echo "configure:6540: checking declaration of size-change" >&5 +echo "configure:6725: 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 @@ -6550,7 +6735,7 @@ do CFLAGS="$cf_save_CFLAGS" test -n "$cf_opts" && CFLAGS="$CFLAGS -D$cf_opts" cat > conftest.$ac_ext <<EOF -#line 6554 "configure" +#line 6739 "configure" #include "confdefs.h" #include <sys/types.h> #if HAVE_TERMIOS_H @@ -6585,7 +6770,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:6589: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6774: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_sizechange=yes else @@ -6617,20 +6802,20 @@ EOF echo $ac_n "checking if ttytype is declared in curses library""... $ac_c" 1>&6 -echo "configure:6621: checking if ttytype is declared in curses library" >&5 +echo "configure:6806: 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 6627 "configure" +#line 6812 "configure" #include "confdefs.h" #include <$cf_cv_ncurses_header> int main() { char *x = &ttytype[1]; *x = 1 ; return 0; } EOF -if { (eval echo configure:6634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cf_cv_have_ttytype=yes else @@ -6655,12 +6840,12 @@ EOF do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6659: checking for $ac_func" >&5 +echo "configure:6844: 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 6664 "configure" +#line 6849 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6683,7 +6868,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:6687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6725,7 +6910,7 @@ EOF EXTRA_DEPS="$EXTRA_DEPS do_chartrans_stuff" echo $ac_n "checking if color-style code should be used""... $ac_c" 1>&6 -echo "configure:6729: checking if color-style code should be used" >&5 +echo "configure:6914: 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 enableval="$enable_color_style" @@ -6771,7 +6956,7 @@ EOF echo "$ac_t""curses-style" 1>&6 echo $ac_n "checking for location of style-sheet file""... $ac_c" 1>&6 -echo "configure:6775: checking for location of style-sheet file" >&5 +echo "configure:6960: 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" @@ -6782,7 +6967,7 @@ EOF esac echo $ac_n "checking if you want to use zlib for decompression of some gzip files""... $ac_c" 1>&6 -echo "configure:6786: checking if you want to use zlib for decompression of some gzip files" >&5 +echo "configure:6971: 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 withval="$with_zlib" @@ -6798,12 +6983,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:6802: checking for gzopen" >&5 +echo "configure:6987: 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 6807 "configure" +#line 6992 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gzopen(); below. */ @@ -6826,7 +7011,7 @@ gzopen(); ; return 0; } EOF -if { (eval echo configure:6830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_gzopen=yes" else @@ -6846,17 +7031,17 @@ else cf_save_LIBS="$LIBS" echo $ac_n "checking for gzopen in -lz""... $ac_c" 1>&6 -echo "configure:6850: checking for gzopen in -lz" >&5 +echo "configure:7035: checking for gzopen in -lz" >&5 LIBS="-lz $LIBS" cat > conftest.$ac_ext <<EOF -#line 6853 "configure" +#line 7038 "configure" #include "confdefs.h" #include <zlib.h> int main() { gzopen("name","mode") ; return 0; } EOF -if { (eval echo configure:6860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7045: \"$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 @@ -6883,17 +7068,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:6887: checking for -lz in $cf_libdir" >&5 +echo "configure:7072: checking for -lz in $cf_libdir" >&5 LIBS="-L$cf_libdir -lz $cf_save_LIBS" cat > conftest.$ac_ext <<EOF -#line 6890 "configure" +#line 7075 "configure" #include "confdefs.h" #include <zlib.h> int main() { gzopen("name","mode") ; return 0; } EOF -if { (eval echo configure:6897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7082: \"$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 @@ -6929,7 +7114,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:6933: checking if directory-editor code should be used" >&5 +echo "configure:7118: 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 enableval="$enable_dired" @@ -6954,7 +7139,7 @@ EOF echo $ac_n "checking if you wish to allow extracting from archives via DirEd""... $ac_c" 1>&6 -echo "configure:6958: checking if you wish to allow extracting from archives via DirEd" >&5 +echo "configure:7143: 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 enableval="$enable_dired_archive" @@ -6972,7 +7157,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:6976: checking if you wish to allow users to redefine DirEd keys" >&5 +echo "configure:7161: 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 enableval="$enable_dired_override" @@ -6997,7 +7182,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:7001: checking if you wish to allow permissions commands via DirEd" >&5 +echo "configure:7186: 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 enableval="$enable_dired_permit" @@ -7022,7 +7207,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:7026: checking if you wish to allow executable-permission commands via DirEd" >&5 +echo "configure:7211: 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 enableval="$enable_dired_xpermit" @@ -7040,7 +7225,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:7044: checking if you wish to allow \"tar\" commands from DirEd" >&5 +echo "configure:7229: 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 enableval="$enable_dired_tar" @@ -7065,7 +7250,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:7069: checking if you wish to allow \"uudecode\" commands from DirEd" >&5 +echo "configure:7254: 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 enableval="$enable_dired_uudecode" @@ -7090,7 +7275,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:7094: checking if you wish to allow \"zip\" and \"unzip\" commands from DirEd" >&5 +echo "configure:7279: 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 enableval="$enable_dired_zip" @@ -7115,7 +7300,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:7119: checking if you wish to allow \"gzip\" and \"gunzip\" commands from DirEd" >&5 +echo "configure:7304: 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 enableval="$enable_dired_gzip" @@ -7141,7 +7326,7 @@ fi fi echo $ac_n "checking if you want long-directory listings""... $ac_c" 1>&6 -echo "configure:7145: checking if you want long-directory listings" >&5 +echo "configure:7330: 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 enableval="$enable_long_list" @@ -7166,7 +7351,7 @@ fi echo "$ac_t""$enableval" 1>&6 echo $ac_n "checking if parent-directory references are permitted""... $ac_c" 1>&6 -echo "configure:7170: checking if parent-directory references are permitted" >&5 +echo "configure:7355: 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 enableval="$enable_parent_dir_refs" @@ -7186,11 +7371,15 @@ echo "$ac_t""$enableval" 1>&6 ### Finally, build config.h and the makefiles CFLAGS="$CFLAGS $EXTRA_CFLAGS" srcdir="$srcdir" +SRCDIR_CLEAN="#" if test -n "$srcdir" ; then echo srcdir is $srcdir $srcdir/mkdirs.sh WWW/Library/unix $srcdir/mkdirs.sh src/chrtrans + test "$srcdir" != "." && SRCDIR_CLEAN="" fi + + trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure @@ -7360,8 +7549,10 @@ s%@UNZIP@%$UNZIP%g s%@UUDECODE@%$UUDECODE%g s%@ZCAT@%$ZCAT%g s%@ZIP@%$ZIP%g +s%@LIBOBJS@%$LIBOBJS%g s%@EXTRA_OBJS@%$EXTRA_OBJS%g s%@EXTRA_DEPS@%$EXTRA_DEPS%g +s%@SRCDIR_CLEAN@%$SRCDIR_CLEAN%g CEOF EOF diff --git a/configure.in b/configure.in index 12dfed53..d56702c7 100644 --- a/configure.in +++ b/configure.in @@ -47,7 +47,7 @@ CF_ARG_ENABLE(debug, AC_MSG_RESULT($with_debug) if test "$with_debug" = "yes" ; then case $host_os in - ultrix*|osf4.*) + ultrix*|osf[34].*) CF_STRIP_O_OPT(CFLAGS) if test -z "$GCC" ; then CFLAGS="$CFLAGS -g3" @@ -288,6 +288,7 @@ dnl -------------------------------------------------------------------------- AC_HEADER_STDC AC_HEADER_TIME AC_HEADER_DIRENT +dnl Don't check for sys/wait.h here since it is covered by another test. AC_CHECK_HEADERS( \ fcntl.h \ limits.h \ @@ -303,6 +304,7 @@ AC_CHECK_HEADERS( \ ) CF_TERMIO_AND_TERMIOS CF_FUNC_WAIT +AC_TYPE_MODE_T dnl -------------------------------------------------------------------------- dnl Checks for library units @@ -313,10 +315,18 @@ CF_REMOVE_BROKEN AC_CHECK_FUNCS( \ cuserid \ getcwd \ + getgroups \ putenv \ readdir \ waitpid \ ) +AC_REPLACE_FUNCS( \ + mktime \ + strstr \ +) + +CF_CHECK_FUNCDECLS([#include <string.h>], strstr) +CF_CHECK_FUNCDECLS([#include <grp.h>], getgrgid getgrnam) dnl -------------------------------------------------------------------------- dnl Checks for external-data @@ -491,11 +501,15 @@ AC_MSG_RESULT($enableval) ### Finally, build config.h and the makefiles CFLAGS="$CFLAGS $EXTRA_CFLAGS" srcdir="$srcdir" +SRCDIR_CLEAN="#" if test -n "$srcdir" ; then echo srcdir is $srcdir $srcdir/mkdirs.sh WWW/Library/unix $srcdir/mkdirs.sh src/chrtrans + test "$srcdir" != "." && SRCDIR_CLEAN="" fi + +AC_SUBST(SRCDIR_CLEAN) AC_OUTPUT( makefile \ WWW/Library/unix/makefile \ diff --git a/docs/README.defines b/docs/README.defines index 2218c2b5..f71da85f 100644 --- a/docs/README.defines +++ b/docs/README.defines @@ -1,6 +1,4 @@ -[ If README.configure goes away, "(see README.configure)" has to change ] - -A place to list preprocessor macros (symbols) which are tested in the +This file lists preprocessor macros (symbols) which are tested in the code (typically with ifdef). Does not include @@ -54,25 +52,25 @@ Network related, specific protocols Related to DirEd code - probably one usable for UNIX or similar --------------------------------------------------------------- -# -DDIRED_SUPPORT (see README.configure) -# -DOK_GZIP (see README.configure) -# -DOK_OVERRIDE (see README.configure) -# -DOK_PERMIT (see README.configure) -# -DOK_TAR (see README.configure) -# -DOK_UUDECODE (see README.configure) -# -DOK_ZIP (see README.configure) -# -DARCHIVE_ONLY (see README.configure) -# -DNO_CHANGE_EXECUTE_PERMS (see README.configure) +# -DDIRED_SUPPORT (see INSTALLATION, Section II-1c) +# -DOK_GZIP (see INSTALLATION, Section II-1c) +# -DOK_OVERRIDE (see INSTALLATION, Section II-1c) +# -DOK_PERMIT (see INSTALLATION, Section II-1c) +# -DOK_TAR (see INSTALLATION, Section II-1c) +# -DOK_UUDECODE (see INSTALLATION, Section II-1c) +# -DOK_ZIP (see INSTALLATION, Section II-1c) +# -DARCHIVE_ONLY (see INSTALLATION, Section II-1c) +# -DNO_CHANGE_EXECUTE_PERMS (see INSTALLATION, Section II-1c) Related to formatting of local directory listings ------------------------------------------------- -# -DLONG_LIST (see README.configure) -# -DNO_PARENT_DIR_REFERENCE (see README.configure) +# -DLONG_LIST (see INSTALLATION, Section II-1c) +# -DNO_PARENT_DIR_REFERENCE (see INSTALLATION, Section II-1c) Related to screen display ------------------------- Using curses or ncurses library: -# -DNCURSES (see README.configure) +# -DNCURSES (see INSTALLATION, Section II-1c) # -DFANCY_CURSES whether curses lib supports more than very basic stuff for UNIX handled by ./configure, for VMS defined in code # -DNO_KEYPAD (old) or HAVE_KEYPAD (new) whether curses lib uses keypad(). @@ -84,10 +82,11 @@ Using curses or ncurses library: # -DNO_SIZECHANGE (old) or HAVE_SIZECHANGE (new) whether using code to detect new size after size changes of the terminal (window). for UNIX handled by ./configure, may be set in HTUtils.h -# -DNO_SIZECHANGEHACK disable hack for size increase handling. +# -DUSE_SIZECHANGEHACK enable hack to handle increasing the window size + above window size at startup Using slang library: -# -DUSE_SLANG (see README.configure) +# -DUSE_SLANG (see INSTALLATION, Section II-1c) # -DSLANG_MBCS_HACK prevent cutoff lines when using UTF8 console (slang only) Both: # -DREVERSE_CLEAR_SCREEN_PROBLEM @@ -96,17 +95,17 @@ Both: Related to *experimental* (unsupported) character style code ------------------------------------------------------------ -# -DUSE_COLOR_STYLE (see README.configure) probably needs -DNCURSES -# -DUSE_HASH (see README.configure) probably needs the above -# -DLINKEDSTYLES (see README.configure) probably needs the above +# -DUSE_COLOR_STYLE (see INSTALLATION, Section II-1c) probably needs -DNCURSES +# -DUSE_HASH (see INSTALLATION, Section II-1c) probably needs the above +# -DLINKEDSTYLES (see INSTALLATION, Section II-1c) probably needs the above Other ----- # -DDONT_TRACK_INTERNAL_LINKS - Handle following links to same doc differently. -# -DEXP_CHARTRANS (see README.configure - currently needed, WILL GO AWAY) +# -DEXP_CHARTRANS (see INSTALLATION, Section II-1c - currently needed, WILL GO AWAY) # -DEXP_CHARTRANS_AUTOSWITCH also let lynx switch term mode(Linux console only) # -DIGNORE_CTRL_C Define if Control-C shouldn't exit lynx. -# -DLY_FIND_LEAKS (see README.configure) +# -DLY_FIND_LEAKS (see INSTALLATION, Section II-1c) # -DNO_CPU_LIMIT Disables Max CPU timeout (includes CLOCKS_PER_SECOND) # -DNSL_FORK For fork-based name server lookups that can be 'z'apped. # -DSYSLOG_REQUESTED_URLS diff --git a/lynx_help/keystrokes/edit_help.html b/lynx_help/keystrokes/edit_help.html index 4baa7232..52c081b2 100644 --- a/lynx_help/keystrokes/edit_help.html +++ b/lynx_help/keystrokes/edit_help.html @@ -33,6 +33,8 @@ be selected via the 'o'ptions menu. This is the <em>Default Binding</em>: LOWER Lower case the line - Ctrl-K UPPER Upper case the line - Ctrl-T + + LKCMD Invoke cmd prompt - Ctrl-V (in form text fields, only) </pre> </body> </html> diff --git a/lynx_help/keystrokes/keystroke_help.html b/lynx_help/keystrokes/keystroke_help.html index 5011d86e..e41a7a9e 100644 --- a/lynx_help/keystrokes/keystroke_help.html +++ b/lynx_help/keystrokes/keystroke_help.html @@ -72,6 +72,7 @@ ! - Spawn your default shell ' - Toggle "historical" vs minimal or valid comment parsing + _ - Clear all authorization info for this session ` - Toggle minimal or valid comment parsing * - Toggle image_links mode on and off @ - Toggle raw 8-bit translations or CJK mode diff --git a/lynx_help/keystrokes/other_help.html b/lynx_help/keystrokes/other_help.html index 1d507968..b43f8326 100644 --- a/lynx_help/keystrokes/other_help.html +++ b/lynx_help/keystrokes/other_help.html @@ -88,6 +88,13 @@ requiring pairs of two successive dashes to delimit comments within the angle-brackets. + _ - Clears all authorization info for the current session. Can + be used when leaving one's terminal without ending the Lynx + session, to guard against someone else retrieving protected + documents with previously entered username/password info. + Note that any protected documents that are still in cache + can still be accessed. + ` - Toggles minimal or valid comment parsing. When minimal, any two successive dashes followed by a close-angle-bracket will be treated as a comment terminator, emulating the parsing bug diff --git a/makefile.in b/makefile.in index 1f67935b..356a778d 100644 --- a/makefile.in +++ b/makefile.in @@ -35,7 +35,7 @@ mandir= @mandir@/man1 ## Where you want the lynx.cfg file installed libdir= @libdir@ -installbin= @INSTALL_PROGRAM@ -c -s -m 755 +installbin= @INSTALL_PROGRAM@ -s -m 755 installdoc= @INSTALL_DATA@ ##set the relative location of the WWW library Implementation directory, @@ -199,8 +199,8 @@ distclean: clean -cd src/chrtrans && $(MAKE) $@ -rm -f *~ *.bak *.sav -rm -f WWW/Library/unix/makefile src/makefile src/chrtrans/makefile - -rmdir WWW/Library/unix && rmdir WWW/Library && rmdir WWW - -rmdir src/chrtrans && rmdir src + @SRCDIR_CLEAN@-rmdir WWW/Library/unix && rmdir WWW/Library && rmdir WWW + @SRCDIR_CLEAN@-rmdir src/chrtrans && rmdir src -rm -f makefile lynx_cfg.h config.status config.log config.cache -rm -f lynx diff --git a/src/HTML.c b/src/HTML.c index 283c375f..a21fee2c 100644 --- a/src/HTML.c +++ b/src/HTML.c @@ -4436,7 +4436,7 @@ PRIVATE void HTML_start_element ARGS6( */ if (!me->inFORM) { if (TRACE) { - fprintf(stderr, "HTML: ***** BUTTON tag not within FORM element *****\n"); + fprintf(stderr, "Bad HTML: BUTTON tag not within FORM element *****\n"); } else if (!me->inBadHTML) { _statusline(BAD_HTML_USE_TRACE); me->inBadHTML = TRUE; @@ -4691,7 +4691,7 @@ PRIVATE void HTML_start_element ARGS6( */ if (!me->inFORM) { if (TRACE) { - fprintf(stderr, "HTML: ***** INPUT tag not within FORM element *****\n"); + fprintf(stderr, "Bad HTML: INPUT tag not within FORM element *****\n"); } else if (!me->inBadHTML) { _statusline(BAD_HTML_USE_TRACE); me->inBadHTML = TRUE; @@ -4710,7 +4710,8 @@ PRIVATE void HTML_start_element ARGS6( */ if (me->inTEXTAREA) { if (TRACE) { - fprintf(stderr, "HTML: ***** Missing TEXTAREA end tag. *****\n"); + fprintf(stderr, + "Bad HTML: Missing TEXTAREA end tag. *****\n"); } else if (!me->inBadHTML) { _statusline(BAD_HTML_USE_TRACE); me->inBadHTML = TRUE; @@ -5070,7 +5071,7 @@ PRIVATE void HTML_start_element ARGS6( if (!me->inFORM) { if (TRACE) { fprintf(stderr, - "HTML: ***** TEXTAREA start tag not within FORM element *****\n"); + "Bad HTML: TEXTAREA start tag not within FORM element *****\n"); } else if (!me->inBadHTML) { _statusline(BAD_HTML_USE_TRACE); me->inBadHTML = TRUE; @@ -5163,7 +5164,7 @@ PRIVATE void HTML_start_element ARGS6( if (me->inSELECT) { if (TRACE) { fprintf(stderr, - "HTML: ***** SELECT start tag in SELECT element. Faking SELECT end tag. *****\n"); + "Bad HTML: SELECT start tag in SELECT element. Faking SELECT end tag. *****\n"); } else if (!me->inBadHTML) { _statusline(BAD_HTML_USE_TRACE); me->inBadHTML = TRUE; @@ -5190,7 +5191,7 @@ PRIVATE void HTML_start_element ARGS6( if (!me->inFORM) { if (TRACE) { fprintf(stderr, - "HTML: ***** SELECT start tag not within FORM element *****\n"); + "Bad HTML: SELECT start tag not within FORM element *****\n"); } else if (!me->inBadHTML) { _statusline(BAD_HTML_USE_TRACE); me->inBadHTML = TRUE; @@ -5213,7 +5214,7 @@ PRIVATE void HTML_start_element ARGS6( */ if (me->inTEXTAREA) { if (TRACE) { - fprintf(stderr, "HTML: ***** Missing TEXTAREA end tag *****\n"); + fprintf(stderr, "Bad HTML: Missing TEXTAREA end tag *****\n"); } else if (!me->inBadHTML) { _statusline(BAD_HTML_USE_TRACE); me->inBadHTML = TRUE; @@ -5307,7 +5308,7 @@ PRIVATE void HTML_start_element ARGS6( if (!me->inSELECT) { if (TRACE) { fprintf(stderr, - "HTML: ***** OPTION tag not within SELECT element *****\n"); + "Bad HTML: OPTION tag not within SELECT element *****\n"); } else if (!me->inBadHTML) { _statusline(BAD_HTML_USE_TRACE); me->inBadHTML = TRUE; @@ -5563,9 +5564,9 @@ PRIVATE void HTML_start_element ARGS6( HTML_end_element(me, HTML_U, (char **)&include); } me->inTABLE = TRUE; - if (me->sp[0].tag_number == HTML_PRE) { + if (!strcmp(me->sp->style->name, "Preformatted")) { UPDATE_STYLE; - LYCheckForID(me, present, value, (int)HTML_TABLE_ID); + CHECK_ID(HTML_TABLE_ID); break; } if (me->Division_Level < (MAX_NESTING - 1)) { @@ -5623,6 +5624,11 @@ PRIVATE void HTML_start_element ARGS6( } me->in_word = NO; + if (!strcmp(me->sp->style->name, "Preformatted")) { + CHECK_ID(HTML_TR_ID); + me->inP = FALSE; + break; + } if (LYoverride_default_alignment(me)) { me->sp->style->alignment = styles[me->sp[0].tag_number]->alignment; } else if (me->List_Nesting_Level >= 0 || @@ -5952,7 +5958,7 @@ PRIVATE void HTML_end_element ARGS3( */ if (me->inTEXTAREA && element_number != HTML_TEXTAREA) if (TRACE) { - fprintf(stderr, "HTML: ***** Missing TEXTAREA end tag *****\n"); + fprintf(stderr, "Bad HTML: Missing TEXTAREA end tag *****\n"); } else if (!me->inBadHTML) { _statusline(BAD_HTML_USE_TRACE); me->inBadHTML = TRUE; @@ -5970,7 +5976,7 @@ PRIVATE void HTML_end_element ARGS3( if (me->inA || me->inSELECT || me->inTEXTAREA) if (TRACE) { fprintf(stderr, - "HTML: ***** %s%s%s%s%s not closed before HTML end tag\n", + "Bad HTML: %s%s%s%s%s not closed before HTML end tag *****\n", me->inSELECT ? "SELECT" : "", (me->inSELECT && me->inTEXTAREA) ? ", " : "", me->inTEXTAREA ? "TEXTAREA" : "", @@ -6086,7 +6092,7 @@ PRIVATE void HTML_end_element ARGS3( if (me->inA || me->inSELECT || me->inTEXTAREA) if (TRACE) { fprintf(stderr, - "HTML: ***** %s%s%s%s%s not closed before BODY end tag *****\n", + "Bad HTML: %s%s%s%s%s not closed before BODY end tag *****\n", me->inSELECT ? "SELECT" : "", (me->inSELECT && me->inTEXTAREA) ? ", " : "", me->inTEXTAREA ? "TEXTAREA" : "", @@ -6542,7 +6548,7 @@ PRIVATE void HTML_end_element ARGS3( */ if (TRACE) { fprintf(stderr, - "HTML: ***** Unmatched OBJECT start and end tags. ***** Discarding content:\n%s\n", + "Bad HTML: Unmatched OBJECT start and end tags. ***** Discarding content:\n%s\n", me->object.data); } else if (!me->inBadHTML) { _statusline(BAD_HTML_USE_TRACE); @@ -6620,7 +6626,7 @@ PRIVATE void HTML_end_element ARGS3( } else { if (TRACE) { fprintf(stderr, - "HTML: ***** Unmatched OBJECT start and end tags. ***** Discarding content.\n"); + "Bad HTML: Unmatched OBJECT start and end tags. ***** Discarding content.\n"); goto End_Object; } else if (!me->inBadHTML) { _statusline(BAD_HTML_USE_TRACE); @@ -6824,7 +6830,7 @@ End_Object: */ if (!me->inFORM) { if (TRACE) { - fprintf(stderr, "HTML: ***** Unmatched FORM end tag *****\n"); + fprintf(stderr, "Bad HTML: Unmatched FORM end tag *****\n"); } else if (!me->inBadHTML) { _statusline(BAD_HTML_USE_TRACE); me->inBadHTML = TRUE; @@ -6846,7 +6852,7 @@ End_Object: if (me->inSELECT) { if (TRACE) { fprintf(stderr, - "HTML: ***** Open SELECT at FORM end. Faking SELECT end tag. *****\n"); + "Bad HTML: Open SELECT at FORM end. Faking SELECT end tag. *****\n"); } else if (!me->inBadHTML) { _statusline(BAD_HTML_USE_TRACE); me->inBadHTML = TRUE; @@ -6909,7 +6915,7 @@ End_Object: */ if (!me->inTEXTAREA) { if (TRACE) { - fprintf(stderr, "HTML: ***** Unmatched TEXTAREA end tag *****\n"); + fprintf(stderr, "Bad HTML: Unmatched TEXTAREA end tag *****\n"); } else if (!me->inBadHTML) { _statusline(BAD_HTML_USE_TRACE); me->inBadHTML = TRUE; @@ -7060,7 +7066,7 @@ End_Object: */ if (!me->inSELECT) { if (TRACE) { - fprintf(stderr, "HTML: ***** Unmatched SELECT end tag *****\n"); + fprintf(stderr, "Bad HTML: Unmatched SELECT end tag *****\n"); } else if (!me->inBadHTML) { _statusline(BAD_HTML_USE_TRACE); me->inBadHTML = TRUE; @@ -7085,7 +7091,7 @@ End_Object: if (!me->inFORM) { if (TRACE) { fprintf(stderr, - "HTML: ***** SELECT end tag not within FORM element *****\n"); + "Bad HTML: SELECT end tag not within FORM element *****\n"); } else if (!me->inBadHTML) { _statusline(BAD_HTML_USE_TRACE); me->inBadHTML = TRUE; @@ -7175,7 +7181,7 @@ End_Object: case HTML_TABLE: me->inTABLE = FALSE; - if (me->sp[0].tag_number == HTML_PRE) { + if (!strcmp(me->sp->style->name, "Preformatted")) { break; } if (me->Division_Level >= 0) @@ -7405,7 +7411,7 @@ PRIVATE void HTML_free ARGS1(HTStructured *, me) */ if (TRACE) { fprintf(stderr, - "HTML_free: ***** SELECT or OPTION not ended properly *****\n"); + "Bad HTML: SELECT or OPTION not ended properly *****\n"); } else if (!me->inBadHTML) { _statusline(BAD_HTML_USE_TRACE); me->inBadHTML = TRUE; @@ -7417,7 +7423,7 @@ PRIVATE void HTML_free ARGS1(HTStructured *, me) * markup meant to be shown somewhere. - kw */ if (TRACE) - fprintf(stderr, " ***** leftover option data: %s\n", + fprintf(stderr, "HTML_free: ***** leftover option data: %s\n", me->option.data); HTML_put_string(me, me->option.data); HTChunkClear(&me->option); @@ -7430,7 +7436,7 @@ PRIVATE void HTML_free ARGS1(HTStructured *, me) */ if (TRACE) { fprintf(stderr, - "HTML_free: ***** TEXTAREA not used properly *****\n"); + "Bad HTML: TEXTAREA not used properly *****\n"); } else if (!me->inBadHTML) { _statusline(BAD_HTML_USE_TRACE); me->inBadHTML = TRUE; @@ -7442,7 +7448,7 @@ PRIVATE void HTML_free ARGS1(HTStructured *, me) * markup meant to be shown somewhere. - kw */ if (TRACE) - fprintf(stderr, " ***** leftover textarea data: %s\n", + fprintf(stderr, "HTML_free: ***** leftover textarea data: %s\n", me->textarea.data); HTML_put_string(me, me->textarea.data); HTChunkClear(&me->textarea); @@ -7478,7 +7484,7 @@ PRIVATE void HTML_free ARGS1(HTStructured *, me) */ if (TRACE) { fprintf(stderr, - "HTML_free: ***** SELECT or OPTION not ended properly *****\n"); + "Bad HTML: SELECT or OPTION not ended properly *****\n"); } else if (!me->inBadHTML) { _statusline(BAD_HTML_USE_TRACE); me->inBadHTML = TRUE; @@ -7486,7 +7492,7 @@ PRIVATE void HTML_free ARGS1(HTStructured *, me) } if (TRACE) { HTChunkTerminate(&me->option); - fprintf(stderr, " ***** leftover option data: %s\n", + fprintf(stderr, "HTML_free: ***** leftover option data: %s\n", me->option.data); } HTChunkClear(&me->option); @@ -7499,7 +7505,7 @@ PRIVATE void HTML_free ARGS1(HTStructured *, me) */ if (TRACE) { fprintf(stderr, - "HTML_free: ***** TEXTAREA not used properly *****\n"); + "Bad HTML: TEXTAREA not used properly *****\n"); } else if (!me->inBadHTML) { _statusline(BAD_HTML_USE_TRACE); me->inBadHTML = TRUE; @@ -7507,7 +7513,7 @@ PRIVATE void HTML_free ARGS1(HTStructured *, me) } if (TRACE) { HTChunkTerminate(&me->textarea); - fprintf(stderr, " ***** leftover textarea data: %s\n", + fprintf(stderr, "HTML_free: ***** leftover textarea data: %s\n", me->textarea.data); } HTChunkClear(&me->textarea); @@ -7576,9 +7582,9 @@ PRIVATE void HTML_abort ARGS2(HTStructured *, me, HTError, e) */ if (TRACE) { fprintf(stderr, - "HTML_abort: ***** SELECT or OPTION not ended properly *****\n"); + "HTML_abort: SELECT or OPTION not ended properly *****\n"); HTChunkTerminate(&me->option); - fprintf(stderr, " ***** leftover option data: %s\n", + fprintf(stderr, "HTML_abort: ***** leftover option data: %s\n", me->option.data); } HTChunkClear(&me->option); @@ -7591,9 +7597,9 @@ PRIVATE void HTML_abort ARGS2(HTStructured *, me, HTError, e) */ if (TRACE) { fprintf(stderr, - "HTML_abort: ***** TEXTAREA not used properly *****\n"); + "HTML_abort: TEXTAREA not used properly *****\n"); HTChunkTerminate(&me->textarea); - fprintf(stderr, " ***** leftover textarea data: %s\n", + fprintf(stderr, "HTML_abort: ***** leftover textarea data: %s\n", me->textarea.data); } HTChunkClear(&me->textarea); diff --git a/src/LYCharUtils.c b/src/LYCharUtils.c index 8b72ffac..20969f52 100644 --- a/src/LYCharUtils.c +++ b/src/LYCharUtils.c @@ -2135,6 +2135,131 @@ PRIVATE char ** LYUCFullyTranslateString_1 ARGS9( } continue; } + if ((code == 1) || + (code > 129 && code < 156)) { + /* + ** Assume these are MicroSoft code points, + ** inflicted on us by FrontPage. - FM + */ + switch (code) { + case 1: + /* + ** WHITE SMILING FACE + */ + code = 0x263a; + break; + case 130: + /* + ** SINGLE LOW-9 QUOTATION MARK (sbquo) + */ + code = 0x201a; + break; + case 132: + /* + ** DOUBLE LOW-9 QUOTATION MARK (bdquo) + */ + code = 0x201e; + break; + case 133: + /* + ** HORIZONTAL ELLIPSIS (hellip) + */ + code = 0x2026; + break; + case 134: + /* + ** DAGGER (dagger) + */ + code = 0x2020; + break; + case 135: + /* + ** DOUBLE DAGGER (Dagger) + */ + code = 0x2021; + break; + case 137: + /* + ** PER MILLE SIGN (permil) + */ + code = 0x2030; + break; + case 139: + /* + ** SINGLE LEFT-POINTING ANGLE QUOTATION MARK + ** (lsaquo) + */ + code = 0x2039; + break; + case 145: + /* + ** LEFT SINGLE QUOTATION MARK (lsquo) + */ + code = 0x2018; + break; + case 146: + /* + ** RIGHT SINGLE QUOTATION MARK (rsquo) + */ + code = 0x2019; + break; + case 147: + /* + ** LEFT DOUBLE QUOTATION MARK (ldquo) + */ + code = 0x201c; + break; + case 148: + /* + ** RIGHT DOUBLE QUOTATION MARK (rdquo) + */ + code = 0x201d; + break; + case 149: + /* + ** BULLET (bull) + */ + code = 0x2022; + break; + case 150: + /* + ** EN DASH (ndash) + */ + code = 0x2013; + break; + case 151: + /* + ** EM DASH (mdash) + */ + code = 0x2014; + break; + case 152: + /* + ** SMALL TILDE (tilde) + */ + code = 0x02dc; + break; + case 153: + /* + ** TRADE MARK SIGN (trade) + */ + code = 0x2122; + break; + case 155: + /* + ** SINGLE RIGHT-POINTING ANGLE QUOTATION MARK + ** (rsaquo) + */ + code = 0x203a; + break; + default: + /* + ** Do not attempt a conversion + ** to valid Unicode values. + */ + break; + } + } /* ** For 173 (shy), use that value if it's ** a hidden INPUT, otherwise ignore it @@ -2155,6 +2280,20 @@ PRIVATE char ** LYUCFullyTranslateString_1 ARGS9( } continue; } + /* + ** For 8211 (ndash or endash), and 8212 + ** (mdash or emdash), use an ASCII hyphen + ** ('-'). - FM + */ + if (code == 8211 || + code == 8212) { + HTChunkPutc(s, '-'); + if (cpe != ';' && cpe != '\0') { + p--; + *p = cpe; + } + continue; + } /* ** Seek a translation from the chartrans tables. */ @@ -2289,6 +2428,40 @@ PRIVATE char ** LYUCFullyTranslateString_1 ARGS9( } continue; /* + ** Ignore (8204) zwnj, if we get to here. - FM + */ + } else if (code == 8204) { + if (TRACE) { + fprintf(stderr, + "LYUnEscapeEntities: Ignoring '%s%s;'.\n", + (isHex ? "&#x" : "&#"), + cp); + } + if (cpe != ';' && cpe != '\0') { + p--; + *p = cpe; + } + continue; + } else + /* + ** Ignore 8205 (zwj), + ** 8206 (lrm), and 8207 (rln), if we get to here. - FM + */ + if (code == 8205 || + code == 8206 || + code == 8207) { + if (TRACE) { + fprintf(stderr, + "LYUnEscapeEntities: Ignoring '%s%s'.\n", + (isHex ? "&#x" : "&#"), + cp); + } + if (cpe != ';' && cpe != '\0') { + p--; + *p = cpe; + } + continue; + /* ** Show the numeric entity if the value: ** (1) Is greater than 255 and unhandled Unicode. */ @@ -2397,6 +2570,77 @@ PRIVATE char ** LYUCFullyTranslateString_1 ARGS9( cp++; cpe = *cp; *cp = '\0'; + + /* + ** For 160 (nbsp), use an ASCII space (32) if + ** plain_space or hidden is TRUE, otherwise use + ** the Lynx special character. - FM + */ + if (!strcmp(p, "nbsp")) { + if (hidden || plain_space) { + HTChunkPutc(s, ' '); + } else { + HTChunkPutc(s, HT_NON_BREAK_SPACE); + } + *cp = cpe; + if (*cp != ';') + p = cp; + else + p = (cp+1); + continue; + } + /* + ** For 173 (shy), skip it if plain_space or hidden is + ** TRUE, otherwise use the Lynx special character. - FM + */ + if (!strcmp(p, "shy")) { + if (!(plain_space || hidden)) { + HTChunkPutc(s, LY_SOFT_HYPHEN); + } + *cp = cpe; + if (*cp != ';') + p = cp; + else + p = (cp+1); + continue; + } + /* + ** For 8194 (ensp), 8195 (emsp), and 8201 + ** (thinsp), use an ASCII space (32) if + ** hidden or plain_space is TRUE, otherwise + ** use the Lynx special character. - FM + */ + if (!strcmp(p, "ensp") || !strcmp(p, "emsp") || + !strcmp(p, "thinsp")) { + if (hidden || plain_space) { + HTChunkPutc(s, ' '); + } else { + HTChunkPutc(s, HT_EM_SPACE); + } + *cp = cpe; + if (*cp != ';') + p = cp; + else + p = (cp+1); + continue; + } + /* + ** For 8211 (ndash or endash), and 8212 + ** (mdash or emdash), use an ASCII space + ** (32). - FM + */ + if (!strcmp(p, "ndash") || + !strcmp(p, "endash") || + !strcmp(p, "mdash") || + !strcmp(p, "emdash")) { + HTChunkPutc(s, '-'); + *cp = cpe; + if (*cp != ';') + p = cp; + else + p = (cp+1); + continue; + } for (low = 0, high = HTML_dtd.number_of_entities; high > low ; diff < 0 ? (low = i+1) : (high = i)) { @@ -2675,6 +2919,57 @@ PRIVATE char ** LYUCFullyTranslateString_1 ARGS9( p = (cp+1); break; } + if ((chk && uck == -4) && + (uck = UCTransUniCharStr(replace_buf, + 60, code, + UCGetLYhndl_byMIME("us-ascii"), + 0) >= 0)) { + /* + ** Got a replacement string (yippey). - FM + */ + HTChunkPuts(s, replace_buf); + *cp = cpe; + if (*cp != ';') + p = cp; + else + p = (cp+1); + continue; + } + /* + ** Ignore (8204) zwnj, if we get to here. - FM + */ + if (!strcmp(p, "zwnj")) { + if (TRACE) { + fprintf(stderr, + "LYUnEscapeEntities: Ignoring '%s'.\n", + p); + } + *cp = cpe; + if (*cp != ';') + p = cp; + else + p = (cp+1); + continue; + } + /* + ** Ignore 8205 (zwj), + ** 8206 (lrm), and 8207 (rln), if we get to here. - FM + */ + if (!strcmp(p, "zwj") || + !strcmp(p, "lrm") || + !strcmp(p, "rlm")) { + if (TRACE) { + fprintf(stderr, + "LYUnEscapeEntities: Ignoring '%s'.\n", + p); + } + *cp = cpe; + if (*cp != ';') + p = cp; + else + p = (cp+1); + continue; + } /* ** Seek a translation from the chartrans tables. */ @@ -3889,7 +4184,7 @@ PUBLIC void LYHandleSELECT ARGS5( if (!me->inFORM) { if (TRACE) { fprintf(stderr, - "HTML: ***** SELECT start tag not within FORM element *****\n"); + "Bad HTML: SELECT start tag not within FORM element *****\n"); } else if (!me->inBadHTML) { _statusline(BAD_HTML_USE_TRACE); me->inBadHTML = TRUE; @@ -3912,7 +4207,7 @@ PUBLIC void LYHandleSELECT ARGS5( */ if (me->inTEXTAREA) { if (TRACE) { - fprintf(stderr, "HTML: ***** Missing TEXTAREA end tag *****\n"); + fprintf(stderr, "Bad HTML: Missing TEXTAREA end tag *****\n"); } else if (!me->inBadHTML) { _statusline(BAD_HTML_USE_TRACE); me->inBadHTML = TRUE; @@ -3998,7 +4293,7 @@ PUBLIC void LYHandleSELECT ARGS5( */ if (!me->inSELECT) { if (TRACE) { - fprintf(stderr, "HTML: ***** Unmatched SELECT end tag *****\n"); + fprintf(stderr, "Bad HTML: Unmatched SELECT end tag *****\n"); } else if (!me->inBadHTML) { _statusline(BAD_HTML_USE_TRACE); me->inBadHTML = TRUE; diff --git a/src/LYCurses.c b/src/LYCurses.c index 23daf95a..3ab3c51c 100644 --- a/src/LYCurses.c +++ b/src/LYCurses.c @@ -236,12 +236,16 @@ PUBLIC void LYbox ARGS2( * specifiy our own ASCII characters for the corners and call * wborder() instead of box(). - kw */ +#ifdef FANCY_CURSES if (!boxvert || !boxhori) box(win, boxvert, boxhori); else if (boxvert == '*' || boxhori == '*') wborder(win, boxvert, boxvert, boxhori, boxhori, '*', '*', '*', '*'); else wborder(win, boxvert, boxvert, boxhori, boxhori, '/', '\\', '\\', '/'); +#else + box(win, boxvert, boxhori); +#endif #ifdef CSS if (formfield) wcurses_css(win, "frame", ABS_OFF); @@ -989,7 +993,7 @@ PUBLIC BOOLEAN setup ARGS1( { static char term_putenv[120]; char buffer[120]; -#if !defined(NO_SIZECHANGEHACK) +#if defined(USE_SIZECHANGEHACK) #if defined(HAVE_SIZECHANGE) && !defined(USE_SLANG) /* * Hack to deal with a problem in sysV curses, that screen can't be @@ -1009,7 +1013,7 @@ PUBLIC BOOLEAN setup ARGS1( (void) putenv(cols_putenv); } #endif /* !NO_SIZECHANGE && !USE_SLANG */ -#endif /* !NO_SIZECHANGEHACK */ +#endif /* USE_SIZECHANGEHACK */ /* * If the display was not set by a command line option then @@ -1056,7 +1060,7 @@ PUBLIC BOOLEAN setup ARGS1( } #endif /* HAVE_TTYTYPE */ -#if defined(HAVE_SIZECHANGE) && !defined(USE_SLANG) && !defined(NO_SIZECHANGEHACK) +#if defined(HAVE_SIZECHANGE) && !defined(USE_SLANG) && defined(USE_SIZECHANGEHACK) if (lines_putenv != NULL) { /* * Use SIGWINCH handler to set the true window size. - AJL && FM @@ -1075,7 +1079,7 @@ PUBLIC BOOLEAN setup ARGS1( #else LYlines = LINES; LYcols = COLS; -#endif /* !NO_SIZECHANGE && !USE_SLANG && !NO_SIZECHANGEHACK */ +#endif /* !NO_SIZECHANGE && !USE_SLANG && USE_SIZECHANGEHACK */ if (LYlines <= 0) LYlines = 24; if (LYcols <= 0) diff --git a/src/LYEditmap.c b/src/LYEditmap.c index cf42ddd2..54c146ff 100644 --- a/src/LYEditmap.c +++ b/src/LYEditmap.c @@ -28,7 +28,7 @@ LYE_NOP, LYE_ENTER, LYE_FORWW, LYE_ABORT, LYE_BACKW, LYE_NOP, LYE_DELN, LYE_NOP, /* ^P XON ^R XOFF */ -LYE_UPPER, LYE_ERASE, LYE_LINKN, LYE_NOP, +LYE_UPPER, LYE_ERASE, LYE_LKCMD, LYE_NOP, /* ^T ^U ^V ^W */ LYE_ERASE, LYE_NOP, LYE_NOP, LYE_NOP, diff --git a/src/LYForms.c b/src/LYForms.c index df0b3b1c..67a11869 100644 --- a/src/LYForms.c +++ b/src/LYForms.c @@ -358,10 +358,15 @@ again: action = EditBinding(ch); if (action == LYE_ENTER) break; - if (action == LYE_LINKN) { - if ((ch = LYReverseKeymap(LYK_F_LINK_NUM)) <= 0) { - ch = DO_NOTHING; + if (action == LYE_LKCMD) { + _statusline(ENTER_LYNX_COMMAND); + ch = LYgetch(); +#ifdef VMS + if (HadVMSInterrupt) { + HadVMSInterrupt = FALSE; + ch = 7; } +#endif /* VMS */ break; } if (action == LYE_AIX && diff --git a/src/LYKeymap.c b/src/LYKeymap.c index 14b80ef1..8cad69e7 100644 --- a/src/LYKeymap.c +++ b/src/LYKeymap.c @@ -123,7 +123,7 @@ LYK_FORM_UP, 0, LYK_FORM_DOWN, LYK_INLINE_TOGGLE, LYK_NOCACHE, 0, LYK_INTERRUPT, LYK_INLINE_TOGGLE, /* X */ /* Y */ /* Z */ /* [ */ -LYK_SOURCE, LYK_HEAD, 0, 0, +LYK_SOURCE, LYK_HEAD, 0, LYK_CLEAR_AUTH, /* \ */ /* ] */ /* ^ */ /* _ */ LYK_MINIMAL, LYK_ADD_BOOKMARK, LYK_PREV_PAGE, LYK_COMMENT, @@ -462,6 +462,7 @@ PRIVATE struct rmap revmap[] = { { "RAW_TOGGLE", "toggle raw 8-bit translations or CJK mode ON or OFF" }, { "COOKIE_JAR", "examine the Cookie Jar" }, { "F_LINK_NUM", "invoke the 'Follow link (or page) number:' prompt" }, +{ "CLEAR_AUTH", "clear all authorization info for this session" }, { "SWITCH_DTD", "switch between two ways of parsing HTML" }, #ifdef USE_EXTERNALS { "EXTERN", "run external program with url" }, diff --git a/src/LYKeymap.h b/src/LYKeymap.h index 133e1f2f..049ade2b 100644 --- a/src/LYKeymap.h +++ b/src/LYKeymap.h @@ -92,16 +92,17 @@ extern char override[]; #define LYK_RAW_TOGGLE 68 #define LYK_COOKIE_JAR 69 #define LYK_F_LINK_NUM 70 -#define LYK_SWITCH_DTD 71 +#define LYK_CLEAR_AUTH 71 +#define LYK_SWITCH_DTD 72 #ifdef USE_EXTERNALS -#define LYK_EXTERN 72 +#define LYK_EXTERN 73 #if defined(VMS) || defined(DIRED_SUPPORT) -#define LYK_DIRED_MENU 73 +#define LYK_DIRED_MENU 74 #endif /* VMS || DIRED_SUPPORT */ #else /* USE_EXTERNALS */ #if defined(VMS) || defined(DIRED_SUPPORT) -#define LYK_DIRED_MENU 72 +#define LYK_DIRED_MENU 73 #endif /* VMS || DIRED_SUPPORT */ #endif /* !defined(USE_EXTERNALS) */ @@ -115,9 +116,9 @@ extern char override[]; #endif /* DIRED_SUPPORT */ #ifdef NOT_USED -#define LYK_VERSION 80 -#define LYK_FORM_UP 81 -#define LYK_FORM_DOWN 82 +#define LYK_VERSION 81 +#define LYK_FORM_UP 82 +#define LYK_FORM_DOWN 83 #endif /* NOT_USED */ #endif /* LYKEYMAP_H */ diff --git a/src/LYLocal.c b/src/LYLocal.c index ba553a68..177af674 100644 --- a/src/LYLocal.c +++ b/src/LYLocal.c @@ -47,7 +47,9 @@ #ifndef VMS #ifndef _WINDOWS +#ifdef HAVE_SYS_WAIT_H #include <sys/wait.h> +#endif #include <errno.h> #include <grp.h> #endif /*_WINDOWS */ diff --git a/src/LYLocal.h b/src/LYLocal.h index 6a042e60..8c1b5730 100644 --- a/src/LYLocal.h +++ b/src/LYLocal.h @@ -7,8 +7,10 @@ #include <types.h> #include <stat.h> #else +#if 0 /* already included in tcp.h */ #include <sys/types.h> #include <sys/stat.h> +#endif #endif /* VMS */ #ifndef S_IRWXU diff --git a/src/LYMainLoop.c b/src/LYMainLoop.c index d73b9a22..208ad88b 100644 --- a/src/LYMainLoop.c +++ b/src/LYMainLoop.c @@ -6,6 +6,8 @@ #include "HTFTP.h" #include "HTFile.h" #include "HTTP.h" +#include "HTAABrow.h" +#include "HTNews.h" #include "LYCurses.h" #include "LYStyle.h" #include "LYGlobalDefs.h" @@ -5322,6 +5324,25 @@ check_add_bookmark_to_self: } break; + case LYK_CLEAR_AUTH: + if (old_c != real_c) { + old_c = real_c; + if (HTConfirm(CLEAR_ALL_AUTH_INFO)) { + FREE(authentication_info[0]); + FREE(authentication_info[1]); + FREE(proxyauth_info[0]); + FREE(proxyauth_info[1]); + HTClearHTTPAuthInfo(); + HTClearNNTPAuthInfo(); + HTClearFTPPassword(); + _statusline(AUTH_INFO_CLEARED); + } else { + _statusline(CANCELLED); + } + sleep(MessageSecs); + } + break; + #ifdef NOT_USED case LYK_VERSION: if (old_c != real_c) { diff --git a/src/LYOptions.c b/src/LYOptions.c index 8cc9886c..5d657a7a 100644 --- a/src/LYOptions.c +++ b/src/LYOptions.c @@ -205,10 +205,14 @@ draw_options: * might have non-ASCII or multibyte/CJK characters. - FM */ response = 0; +#ifdef FANCY_CURSES if (enable_scrollback) clear(); else erase(); +#else + clear(); +#endif move(0, 5); lynx_start_h1_color (); @@ -1795,10 +1799,14 @@ draw_bookmark_list: * to increase the chances that any non-ASCII or multibyte/CJK * characters will be handled properly. - FM */ +#ifdef FANCY_CURSES if (enable_scrollback) clear(); else erase(); +#else + clear(); +#endif move(0, 5); lynx_start_h1_color (); diff --git a/src/LYStrings.c b/src/LYStrings.c index 04cad25f..868590df 100644 --- a/src/LYStrings.c +++ b/src/LYStrings.c @@ -155,7 +155,7 @@ PUBLIC char * LYmbcsstrncpy ARGS5(char *,dst, CONST char *,src, int,n_bytes, /* * LYmbcs_skip_glyphs() skips a given number of display positions * in a string and returns the resulting pointer. It takes account - * of UTF-8 encoded characters. - kw + * of UTF-8 encoded characters. - KW */ PUBLIC char * LYmbcs_skip_glyphs ARGS3( char *, data, @@ -172,7 +172,7 @@ PUBLIC char * LYmbcs_skip_glyphs ARGS3( if (!utf_flag) return (data + n_glyphs); - while(*data) { + while (*data) { if (IS_NEW_GLYPH(*data)) { if (i_glyphs++ >= n_glyphs) { return data; @@ -1086,7 +1086,7 @@ again: return(-1); break; - case LYE_LINKN: + case LYE_LKCMD: /* * Used only in form_getstr() for invoking * the LYK_F_LINK_NUM prompt when in form diff --git a/src/LYStrings.h b/src/LYStrings.h index e6d7f178..df22b35c 100644 --- a/src/LYStrings.h +++ b/src/LYStrings.h @@ -2,9 +2,6 @@ #define LYSTRINGS_H #include <string.h> -#ifdef __STRICT_BSD__ -extern char *strstr(); -#endif /* __STRICT_BSD__ */ extern int get_mouse_link NOPARAMS; extern char * LYstrncpy PARAMS(( @@ -22,6 +19,19 @@ extern char * LYstrstr PARAMS(( char * chptr, char * tarptr)); +extern char * LYmbcsstrncpy PARAMS(( + char * dst, + CONST char * src, + int n_bytes, + int n_glyphs, + int enc)); +extern char * LYmbcs_skip_glyphs PARAMS(( + char * data, + int n_glyphs, + BOOL utf_flag)); +extern int LYmbcsstrlen PARAMS(( + char * str, + BOOL utf_flag)); extern char * LYno_attr_mbcs_strstr PARAMS(( char * chptr, char * tarptr, @@ -34,24 +44,6 @@ extern char * LYno_attr_mbcs_case_strstr PARAMS(( BOOL utf_flag, int * nstartp, int * nendp)); -#ifdef EXP_CHARTRANS -extern int LYmbcsstrlen PARAMS(( - char * str, - BOOL utf_flag)); -extern char * LYmbcs_skip_glyphs PARAMS(( - char * data, - int n_glyphs, - BOOL utf_flag)); -extern char * LYmbcsstrncpy PARAMS(( - char * dst, - CONST char * src, - int n_bytes, - int n_glyphs, - int enc)); -#else -#define LYmbcsstrlen(str,utf_flag) strlen(str) -#define LYmbcsstrncpy(dest,src,n,n_glyphs,enc) LYstrncpy(dest, src, n) -#endif extern char * LYno_attr_char_strstr PARAMS(( char * chptr, @@ -144,9 +136,9 @@ typedef struct _EditFieldData { #define LYE_LOWER (LYE_BACKW +1) /* Lower case the line */ #define LYE_UPPER (LYE_LOWER +1) /* Upper case the line */ -#define LYE_LINKN (LYE_UPPER +1) /* Invoke F_LINK_NUM */ +#define LYE_LKCMD (LYE_UPPER +1) /* Invoke command prompt */ -#define LYE_AIX (LYE_LINKN +1) /* Hex 97 */ +#define LYE_AIX (LYE_LKCMD +1) /* Hex 97 */ extern void LYSetupEdit PARAMS(( EditFieldData * edit, diff --git a/src/LYUtils.c b/src/LYUtils.c index f4ba7728..0ece6343 100644 --- a/src/LYUtils.c +++ b/src/LYUtils.c @@ -347,8 +347,7 @@ PUBLIC void highlight ARGS3( } } if (utf_extra) { - strncpy(&tmp[1], &data[itmp+1], utf_extra); - tmp[utf_extra+1] = '\0'; + LYstrncpy(&tmp[1], &data[itmp+1], utf_extra); itmp += utf_extra; /* * Start emphasis immediately if we are @@ -445,8 +444,7 @@ PUBLIC void highlight ARGS3( } } if (utf_extra) { - strncpy(&tmp[1], &data[itmp+1], utf_extra); - tmp[(utf_extra + 1)] = '\0'; + LYstrncpy(&tmp[1], &data[itmp+1], utf_extra); itmp += utf_extra; /* * Make sure we don't restore emphasis to @@ -625,8 +623,7 @@ highlight_hit_within_hightext: } } if (utf_extra) { - strncpy(&tmp[1], &data[itmp+1], utf_extra); - tmp[utf_extra+1] = '\0'; + LYstrncpy(&tmp[1], &data[itmp+1], utf_extra); itmp += utf_extra; /* * Start emphasis immediately if we are making @@ -729,8 +726,7 @@ highlight_hit_within_hightext: } } if (utf_extra) { - strncpy(&tmp[1], &data[itmp+1], utf_extra); - tmp[utf_extra+1] = '\0'; + LYstrncpy(&tmp[1], &data[itmp+1], utf_extra); itmp += utf_extra; /* * Make sure we don't restore emphasis to @@ -898,8 +894,7 @@ highlight_hit_within_hightext: } } if (utf_extra) { - strncpy(&tmp[1], &data[itmp+1], utf_extra); - tmp[(utf_extra + 1)] = '\0'; + LYstrncpy(&tmp[1], &data[itmp+1], utf_extra); itmp += utf_extra; /* * Make sure we don't restore emphasis to @@ -1082,8 +1077,7 @@ highlight_search_hightext2: } } if (utf_extra) { - strncpy(&tmp[1], &data[itmp+1], utf_extra); - tmp[utf_extra+1] = '\0'; + LYstrncpy(&tmp[1], &data[itmp+1], utf_extra); itmp += utf_extra; /* * Start emphasis immediately if we are @@ -1180,8 +1174,7 @@ highlight_search_hightext2: } } if (utf_extra) { - strncpy(&tmp[1], &data[itmp+1], utf_extra); - tmp[(utf_extra + 1)] = '\0'; + LYstrncpy(&tmp[1], &data[itmp+1], utf_extra); itmp += utf_extra; /* * Make sure we don't restore emphasis to @@ -1267,7 +1260,6 @@ highlight_search_hightext2: (offset - Offset), utf_flag); } - data = (Data + (offset - Offset)); if ((case_sensitive ? (cp = LYno_attr_mbcs_strstr(data, target, @@ -1360,8 +1352,7 @@ highlight_hit_within_hightext2: } } if (utf_extra) { - strncpy(&tmp[1], &data[itmp+1], utf_extra); - tmp[utf_extra+1] = '\0'; + LYstrncpy(&tmp[1], &data[itmp+1], utf_extra); itmp += utf_extra; /* * Start emphasis immediately if we are making @@ -1464,8 +1455,7 @@ highlight_hit_within_hightext2: } } if (utf_extra) { - strncpy(&tmp[1], &data[itmp+1], utf_extra); - tmp[utf_extra+1] = '\0'; + LYstrncpy(&tmp[1], &data[itmp+1], utf_extra); itmp += utf_extra; /* * Make sure we don't restore emphasis to @@ -1633,8 +1623,7 @@ highlight_hit_within_hightext2: } } if (utf_extra) { - strncpy(&tmp[1], &data[itmp+1], utf_extra); - tmp[(utf_extra + 1)] = '\0'; + LYstrncpy(&tmp[1], &data[itmp+1], utf_extra); itmp += utf_extra; /* * Make sure we don't restore emphasis to @@ -3421,7 +3410,7 @@ PUBLIC void tempname ARGS2( fclose(fp); if (TRACE) fprintf(stderr, - "tempname: file '%s' already exits!\n", + "tempname: file '%s' already exists!\n", namebuffer); counter++; continue; @@ -3439,7 +3428,7 @@ PUBLIC void tempname ARGS2( fclose(fp); if (TRACE) fprintf(stderr, - "tempname: file '%s' already exits!\n", + "tempname: file '%s' already exists!\n", namebuffer); counter++; continue; @@ -3457,7 +3446,7 @@ PUBLIC void tempname ARGS2( fclose(fp); if (TRACE) fprintf(stderr, - "tempname: file '%s' already exits!\n", + "tempname: file '%s' already exists!\n", namebuffer); continue; } diff --git a/src/UCdomap.c b/src/UCdomap.c index e81ad05c..2bd75f5a 100644 --- a/src/UCdomap.c +++ b/src/UCdomap.c @@ -1577,8 +1577,8 @@ PUBLIC int UCGetLYhndl_byMIME ARGS1( isdigit((unsigned char)UC_MIMEcharset[5])) { char tmp[16]; /* - * For "cpNNNN", try "windows-NNNN" - * if not yet found. - kw + * For "cp1NNN", try "windows-1NNN" + * if not yet found. - KW */ sprintf(tmp, "windows-%s", UC_MIMEcharset + 2); return UCGetLYhndl_byMIME(tmp); diff --git a/src/makefile.in b/src/makefile.in index 203e97b2..e6f436f5 100644 --- a/src/makefile.in +++ b/src/makefile.in @@ -49,7 +49,7 @@ LYForms.o LYPrint.o LYrcFile.o LYDownload.o LYNews.o LYKeymap.o \ HTML.o HTFWriter.o HTInit.o DefaultStyle.o LYLocal.o LYUpload.o \ LYLeaks.o LYexit.o LYJump.o LYList.o LYCgi.o LYTraversal.o \ LYEditmap.o LYCharSets.o LYCharUtils.o LYMap.o LYCookie.o LYExtern.o \ -LYStyle.o LYHash.o @EXTRA_OBJS@ +LYStyle.o LYHash.o @EXTRA_OBJS@ @LIBOBJS@ C_SRC = $(OBJS:.o=.c) diff --git a/src/mktime.c b/src/mktime.c new file mode 100644 index 00000000..0db7f122 --- /dev/null +++ b/src/mktime.c @@ -0,0 +1,77 @@ +/* + * mktime.c -- converts a struct tm into a time_t + * + * Copyright (C) 1997 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 + * Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/* Written by Philippe De Muyter <phdm@macqel.be>. */ + +#include <time.h> + +static time_t +mkgmtime(t) +register struct tm *t; +{ + register short month, year; + register long time; + static int m_to_d[12] = +{0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}; + + month = t->tm_mon; + year = t->tm_year + month / 12 + 1900; + month %= 12; + if (month < 0) + { + year -= 1; + month += 12; + } + time = (year - 1970) * 365 + (year - 1969) / 4 + m_to_d[month]; + time = (year - 1970) * 365 + m_to_d[month]; + if (month <= 1) + year -= 1; + time += (year - 1968) / 4; + time -= (year - 1900) / 100; + time += (year - 1600) / 400; + time += t->tm_mday; + time -= 1; + time *= 24; + time += t->tm_hour; + time *= 60; + time += t->tm_min; + time *= 60; + time += t->tm_sec; + return(time); +} + +/* +** mktime -- convert tm struct to time_t +** if tm_isdst >= 0 use it, else compute it +*/ + +time_t +mktime(t) +struct tm *t; +{ + time_t now; + + tzset(); + now = mkgmtime(t) + timezone; + if (t->tm_isdst > 0 + || (t->tm_isdst < 0 && localtime(&now)->tm_isdst)) + now -= 3600; + return(now); +} diff --git a/src/strstr.c b/src/strstr.c new file mode 100644 index 00000000..3d7442c1 --- /dev/null +++ b/src/strstr.c @@ -0,0 +1,64 @@ +/* + * strstr.c -- return the offset of one string within another. + * + * Copyright (C) 1997 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 + * Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/* Written by Philippe De Muyter <phdm@macqel.be>. */ + +/* + * NAME + * + * strstr -- locate first occurrence of a substring + * + * SYNOPSIS + * + * char *strstr (char *s1, char *s2) + * + * DESCRIPTION + * + * Locates the first occurrence in the string pointed to by S1 of the string + * pointed to by S2. Returns a pointer to the substring found, or a NULL + * pointer if not found. If S2 points to a string with zero length, the + * function returns S1. + * + * BUGS + * + */ + +char * +strstr (buf, sub) + register char *buf; + register char *sub; +{ + register char *bp; + register char *sp; + + if (!*sub) + return buf; + while (*buf) + { + bp = buf; + sp = sub; + do { + if (!*sp) + return buf; + } while (*bp++ == *sp++); + buf += 1; + } + return 0; +} |