diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/GridText.c | 16 | ||||
-rw-r--r-- | src/HTFWriter.c | 3 | ||||
-rw-r--r-- | src/HTInit.c | 14 | ||||
-rw-r--r-- | src/HTML.c | 6 | ||||
-rw-r--r-- | src/LYBookmark.c | 2 | ||||
-rw-r--r-- | src/LYCharUtils.c | 36 | ||||
-rw-r--r-- | src/LYCurses.c | 10 | ||||
-rw-r--r-- | src/LYEdit.c | 4 | ||||
-rw-r--r-- | src/LYGlobalDefs.h | 2 | ||||
-rw-r--r-- | src/LYKeymap.c | 2 | ||||
-rw-r--r-- | src/LYLocal.c | 16 | ||||
-rw-r--r-- | src/LYMain.c | 88 | ||||
-rw-r--r-- | src/LYMainLoop.c | 158 | ||||
-rw-r--r-- | src/LYNews.c | 24 | ||||
-rw-r--r-- | src/LYReadCFG.c | 8 | ||||
-rw-r--r-- | src/LYUtils.c | 20 | ||||
-rw-r--r-- | src/LYUtils.h | 2 | ||||
-rw-r--r-- | src/LYVMSdef.h | 18 |
18 files changed, 296 insertions, 133 deletions
diff --git a/src/GridText.c b/src/GridText.c index b4b92503..da643f91 100644 --- a/src/GridText.c +++ b/src/GridText.c @@ -3342,7 +3342,7 @@ PUBLIC void HText_endForm ARGS1( /* * Go through list of anchors and get our input field. - FM */ - while (1) { + while (a) { if (a->link_type == INPUT_ANCHOR && a->input_field->number == HTFormNumber && a->input_field->type == F_TEXT_TYPE) { @@ -3482,7 +3482,7 @@ PUBLIC char * HText_setLastOptionValue ARGS5( /* * Deal with newlines or tabs. */ - convert_to_spaces(value); + convert_to_spaces(value, FALSE); if (!op_ptr) { /* @@ -3650,7 +3650,7 @@ PUBLIC int HText_beginInput ARGS2( } else { TextAnchor * b = text->first_anchor; int i = 0; - while (1) { + while (b) { if (b->link_type == INPUT_ANCHOR && b->input_field->type == F_RADIO_TYPE && b->input_field->number == HTFormNumber) { @@ -4020,7 +4020,7 @@ PUBLIC void HText_SubmitForm ARGS4( /* * Go through list of anchors and get size first. */ - while (1) { + while (anchor_ptr) { if (anchor_ptr->link_type == INPUT_ANCHOR) { if (anchor_ptr->input_field->number == form_number) { @@ -4135,7 +4135,7 @@ PUBLIC void HText_SubmitForm ARGS4( /* * Go through list of anchors and assemble URL query. */ - while (1) { + while (anchor_ptr) { if (anchor_ptr->link_type == INPUT_ANCHOR) { if (anchor_ptr->input_field->number == form_number) { @@ -4681,7 +4681,7 @@ PUBLIC void HText_DisableCurrentForm NOARGS /* * Go through list of anchors and set the disabled flag. */ - while (1) { + while (anchor_ptr) { if (anchor_ptr->link_type == INPUT_ANCHOR && anchor_ptr->input_field->number == HTFormNumber) { @@ -4708,7 +4708,7 @@ PUBLIC void HText_ResetForm ARGS1( /* * Go through list of anchors and reset values. */ - while (1) { + while (anchor_ptr) { if (anchor_ptr->link_type == INPUT_ANCHOR) { if (anchor_ptr->input_field->number == form->number) { @@ -4752,7 +4752,7 @@ PUBLIC void HText_activateRadioButton ARGS1( TextAnchor * anchor_ptr = HTMainText->first_anchor; int form_number = form->number; - while (1) { + while (anchor_ptr) { if (anchor_ptr->link_type == INPUT_ANCHOR && anchor_ptr->input_field->type == F_RADIO_TYPE) { diff --git a/src/HTFWriter.c b/src/HTFWriter.c index 820d0fa0..fac0af78 100644 --- a/src/HTFWriter.c +++ b/src/HTFWriter.c @@ -544,6 +544,8 @@ PUBLIC HTStream* HTSaveToFile ARGS3( if (dump_output_immediately) { ret_obj->fp = stdout; /* stdout*/ + if (HTOutputFormat == HTAtom_for("www/download")) + goto Prepend_BASE; return ret_obj; } @@ -708,6 +710,7 @@ PUBLIC HTStream* HTSaveToFile ARGS3( _statusline(RETRIEVING_FILE); StrAllocCopy(anchor->FileCache, fnam); +Prepend_BASE: if (!strncasecomp(pres->rep->name, "text/html", 9)) { /* * Add the document's base as a BASE tag at the top of the file, diff --git a/src/HTInit.c b/src/HTInit.c index 0864816c..e5dff4e1 100644 --- a/src/HTInit.c +++ b/src/HTInit.c @@ -57,13 +57,13 @@ PUBLIC void HTFormatInit NOARGS if ((cp = getenv(DISPLAY)) != NULL && *cp != '\0') { /* Must have X11 */ HTSetPresentation("application/postscript", "ghostview %s&", 1.0, 3.0, 0.0, 0); - HTSetPresentation("image/gif", XLOADIMAGE_COMMAND, 1.0, 3.0, 0.0, 0); - HTSetPresentation("image/x-xbm", XLOADIMAGE_COMMAND, 1.0, 3.0, 0.0, 0); - HTSetPresentation("image/x-xbitmap", XLOADIMAGE_COMMAND, 1.0, 3.0, 0.0, 0); - HTSetPresentation("image/x-png", XLOADIMAGE_COMMAND, 1.0, 3.0, 0.0, 0); - HTSetPresentation("image/x-rgb", XLOADIMAGE_COMMAND, 1.0, 3.0, 0.0, 0); - HTSetPresentation("image/x-tiff", XLOADIMAGE_COMMAND, 1.0, 3.0, 0.0, 0); - HTSetPresentation("image/jpeg", XLOADIMAGE_COMMAND, 1.0, 3.0, 0.0, 0); + HTSetPresentation("image/gif", XLoadImageCommand, 1.0, 3.0, 0.0, 0); + HTSetPresentation("image/x-xbm", XLoadImageCommand, 1.0, 3.0, 0.0, 0); + HTSetPresentation("image/x-xbitmap", XLoadImageCommand, 1.0, 3.0, 0.0, 0); + HTSetPresentation("image/x-png", XLoadImageCommand, 1.0, 3.0, 0.0, 0); + HTSetPresentation("image/x-rgb", XLoadImageCommand, 1.0, 3.0, 0.0, 0); + HTSetPresentation("image/x-tiff", XLoadImageCommand, 1.0, 3.0, 0.0, 0); + HTSetPresentation("image/jpeg", XLoadImageCommand, 1.0, 3.0, 0.0, 0); HTSetPresentation("video/mpeg", "mpeg_play %s &", 1.0, 3.0, 0.0, 0); } diff --git a/src/HTML.c b/src/HTML.c index 5ca1756c..dcdb5fbe 100644 --- a/src/HTML.c +++ b/src/HTML.c @@ -2287,7 +2287,7 @@ PRIVATE void HTML_start_element ARGS5( else if (dest_ismap || present[HTML_IMG_ISMAP]) { StrAllocCopy(alt_string, (title ? title : "[ISMAP]")); - } else if (me->inA == TRUE) { + } else if (me->inA == TRUE && dest) { StrAllocCopy(alt_string, (title ? title : "[LINK]")); } else { @@ -2307,7 +2307,7 @@ PRIVATE void HTML_start_element ARGS5( StrAllocCopy(alt_string, (title ? title : "[ISMAP]")); - } else if (me->inA == TRUE) { + } else if (me->inA == TRUE && dest) { StrAllocCopy(alt_string, (title ? title : "[LINK]")); @@ -3728,7 +3728,7 @@ PRIVATE void HTML_start_element ARGS5( * Convert any newlines or tabs to spaces, * and trim any lead or trailing spaces. - FM */ - convert_to_spaces(I.value); + convert_to_spaces(I.value, FALSE); while (I.value && I.value[0] == ' ') I.value++; len = strlen(I.value) - 1; diff --git a/src/LYBookmark.c b/src/LYBookmark.c index 8f574bc1..de1b8d07 100644 --- a/src/LYBookmark.c +++ b/src/LYBookmark.c @@ -285,7 +285,7 @@ PUBLIC void save_bookmark_link ARGS2( */ string_buffer[255] = '\0'; LYstrncpy(string_buffer, title, 255); - convert_to_spaces(string_buffer); + convert_to_spaces(string_buffer, FALSE); LYMBM_statusline(TITLE_PROMPT); LYgetstr(string_buffer, VISIBLE, sizeof(string_buffer), NORECALL); if (*string_buffer == '\0') { diff --git a/src/LYCharUtils.c b/src/LYCharUtils.c index 5b6b94dd..22085ca5 100644 --- a/src/LYCharUtils.c +++ b/src/LYCharUtils.c @@ -980,9 +980,9 @@ PUBLIC void LYEntify ARGS2( } /* -** This function trims characters <= that of a space (32), -** including HT_NON_BREAK_SPACE (1) and HT_EM_SPACE (2), -** but not ESC, from the tails of strings. - FM +** This function trims characters <= that of a space (32), +** including HT_NON_BREAK_SPACE (1) and HT_EM_SPACE (2), +** but not ESC, from the heads of strings. - FM */ PUBLIC void LYTrimHead ARGS1( char *, str) @@ -1003,9 +1003,9 @@ PUBLIC void LYTrimHead ARGS1( } /* -** This function trims characters <= that of a space (32), -** including HT_NON_BREAK_SPACE (1), HT_EM_SPACE (2), and -** ESC from the tails of strings. - FM +** This function trims characters <= that of a space (32), +** including HT_NON_BREAK_SPACE (1), HT_EM_SPACE (2), and +** ESC from the tails of strings. - FM */ PUBLIC void LYTrimTail ARGS1( char *, str) @@ -1584,7 +1584,7 @@ PUBLIC void LYHandleMETA ARGS4( if (present[HTML_META_HTTP_EQUIV] && value[HTML_META_HTTP_EQUIV] && *value[HTML_META_HTTP_EQUIV]) { StrAllocCopy(http_equiv, value[HTML_META_HTTP_EQUIV]); - convert_to_spaces(http_equiv); + convert_to_spaces(http_equiv, TRUE); LYUnEscapeToLatinOne(&http_equiv, FALSE); LYTrimHead(http_equiv); LYTrimTail(http_equiv); @@ -1595,7 +1595,7 @@ PUBLIC void LYHandleMETA ARGS4( if (present[HTML_META_NAME] && value[HTML_META_NAME] && *value[HTML_META_NAME]) { StrAllocCopy(name, value[HTML_META_NAME]); - convert_to_spaces(name); + convert_to_spaces(name, TRUE); LYUnEscapeToLatinOne(&name, FALSE); LYTrimHead(name); LYTrimTail(name); @@ -1617,7 +1617,7 @@ PUBLIC void LYHandleMETA ARGS4( * of it might be sent to the screen. - FM */ StrAllocCopy(content, value[HTML_META_CONTENT]); - convert_to_spaces(content); + convert_to_spaces(content, FALSE); LYTrimHead(content); LYTrimTail(content); if (*content == '\0') { @@ -2017,7 +2017,23 @@ PUBLIC int LYLegitimizeHREF ARGS3( if (!me || !href || *href == NULL || *(*href) == '\0') return(url_type); - collapse_spaces(*href); + LYTrimHead(*href); + if (!strncasecomp(*href, "lynxexec:", 9) || + !strncasecomp(*href, "lynxprog:", 9)) { + /* + * The original implementions of these schemes expected + * white space without hex escaping, and did not check + * for hex escaping, so we'll continue to support that, + * until that code is redone in conformance with SGML + * principles. - FM + */ + HTUnEscapeSome(*href, " \r\n\t"); + convert_to_spaces(*href, TRUE); + } else { + collapse_spaces(*href); + } + if (*(*href) == '\0') + return(url_type); LYUnEscapeToLatinOne(&(*href), TRUE); url_type = is_url(*href); if (!url_type && force_slash && diff --git a/src/LYCurses.c b/src/LYCurses.c index 8ec8b4d2..d4bda6f1 100644 --- a/src/LYCurses.c +++ b/src/LYCurses.c @@ -394,7 +394,7 @@ PUBLIC BOOLEAN setup ARGS1( * Get terminal type (strip 'dec-' from vms style types). */ if (strncmp((CONST char*)ttytype, "dec-vt", 6) == 0) { - (void) setterm((char *)ttytype + 4); + (void) setterm(ttytype + 4); } #endif /* !NO_TTYTYPE */ @@ -485,13 +485,7 @@ PRIVATE int dumbterm ARGS1( #undef system #endif /* system */ #include <processes.h> - -#ifndef CLI$M_TRUSTED -#define CLI$M_TRUSTED 64 /* May not be in the compiler's clidef.h */ -#endif /* !CLI$M_TRUSTED */ -#ifndef LIB$_INVARG -#define LIB$_INVARG 1409588 -#endif /* !LIB$_INVARG */ +#include "LYVMSdef.h" #define EFN 0 /* Event flag */ diff --git a/src/LYEdit.c b/src/LYEdit.c index 5ac37fbe..2f01982d 100644 --- a/src/LYEdit.c +++ b/src/LYEdit.c @@ -106,6 +106,10 @@ PUBLIC int edit_current_file ARGS3(char *,newfile, int,cur, int,lineno) else sprintf(command,"%s \"%s\"",editor, filename); #endif /* VMS */ + if (TRACE) { + fprintf(stderr, "LYEdit: %s\n",command); + sleep(MessageSecs); + } FREE(filename); stop_curses(); diff --git a/src/LYGlobalDefs.h b/src/LYGlobalDefs.h index bff9785e..005dda32 100644 --- a/src/LYGlobalDefs.h +++ b/src/LYGlobalDefs.h @@ -264,5 +264,5 @@ extern BOOLEAN LYMBMAdvanced; /* MBM statusline for ADVANCED? */ extern int LYStatusLine; /* Line for statusline() or -1 */ extern BOOLEAN LYCollapseBRs; /* Collapse serial BRs? */ extern BOOLEAN LYSetCookies; /* Process Set-Cookie headers? */ - +extern char *XLoadImageCommand; /* Default image viewer for X */ #endif /* LYGLOBALDEFS_H */ diff --git a/src/LYKeymap.c b/src/LYKeymap.c index 2545f6a6..62382e44 100644 --- a/src/LYKeymap.c +++ b/src/LYKeymap.c @@ -416,7 +416,7 @@ PRIVATE struct rmap revmap[] = { { "DOWN_LINK", "move down the page to another link" }, { "RIGHT_LINK", "move right to another link" }, { "LEFT_LINK", "move left to a previous link" }, -{ "HISTORY", "display a list of previously viewed documents" }, +{ "HISTORY", "display stack of currently-suspended documents" }, { "PREV_DOC", "go back to the previous document" }, { "ACTIVATE", "go to the document given by the current link" }, { "GOTO", "go to a document given as a URL" }, diff --git a/src/LYLocal.c b/src/LYLocal.c index d7d36052..78c0233f 100644 --- a/src/LYLocal.c +++ b/src/LYLocal.c @@ -1382,7 +1382,8 @@ PUBLIC int local_dired ARGS1( tp = quote_pathname(line+20); *cp++ = '\0'; cp = quote_pathname(line+20); - sprintf(buffer,"%s -qdc %s | (cd %s; %s -xfe -)",GZIP_PATH, tp,cp, TAR_PATH); + sprintf(buffer, "%s -qdc %s | (cd %s; %s -xf -)", + GZIP_PATH, tp, cp, TAR_PATH); FREE(cp); FREE(tp); # endif /* OK_GZIP */ @@ -1391,7 +1392,8 @@ PUBLIC int local_dired ARGS1( tp = quote_pathname(line+19); *cp++ = '\0'; cp = quote_pathname(line+19); - sprintf(buffer,"%s %s | (cd %s; %s -xfe -)", ZCAT_PATH, tp,cp,TAR_PATH); + sprintf(buffer, "%s %s | (cd %s; %s -xf -)", + ZCAT_PATH, tp, cp, TAR_PATH); FREE(cp); FREE(tp); @@ -1399,7 +1401,7 @@ PUBLIC int local_dired ARGS1( tp = quote_pathname(line+17); *cp++ = '\0'; cp = quote_pathname(line+17); - sprintf(buffer,"cd %s; %s -xfe %s", cp,TAR_PATH, tp); + sprintf(buffer,"cd %s; %s -xf %s", cp, TAR_PATH, tp); FREE(cp); FREE(tp); # endif /* !ARCHIVE_ONLY */ @@ -1409,7 +1411,8 @@ PUBLIC int local_dired ARGS1( *cp++ = '\0'; cp = quote_pathname(cp); tp = quote_pathname(line+18); - sprintf(buffer,"(cd %s; %s -cfe - %s) | %s -qc >%s/%s.tar.gz",tp, TAR_PATH, cp, GZIP_PATH, tp,cp); + sprintf(buffer, "(cd %s; %s -cf - %s) | %s -qc >%s/%s.tar.gz", + tp, TAR_PATH, cp, GZIP_PATH, tp, cp); FREE(cp); FREE(tp); # endif /* OK_GZIP */ @@ -1418,7 +1421,8 @@ PUBLIC int local_dired ARGS1( *cp++ = '\0'; cp = quote_pathname(cp); tp = quote_pathname(line+17); - sprintf(buffer,"(cd %s; %s -cfe - %s) | %s >%s/%s.tar.Z",tp,TAR_PATH, cp,COMPRESS_PATH, tp,cp); + sprintf(buffer, "(cd %s; %s -cf - %s) | %s >%s/%s.tar.Z", + tp, TAR_PATH, cp, COMPRESS_PATH, tp, cp); FREE(cp); FREE(tp); @@ -1426,7 +1430,7 @@ PUBLIC int local_dired ARGS1( *cp++ = '\0'; cp = quote_pathname(cp); tp = quote_pathname(line+15); - sprintf(buffer,"(cd %s; %s -cfe %s.tar %s)",tp,TAR_PATH, cp, cp); + sprintf(buffer,"(cd %s; %s -cf %s.tar %s)", tp, TAR_PATH, cp, cp); FREE(cp); FREE(tp); #endif /* OK_TAR */ diff --git a/src/LYMain.c b/src/LYMain.c index 6c45c54d..85167077 100644 --- a/src/LYMain.c +++ b/src/LYMain.c @@ -305,6 +305,7 @@ PUBLIC BOOLEAN LYMBMAdvanced = TRUE; PUBLIC int LYStatusLine = -1; /* Line for statusline() if > -1 */ PUBLIC BOOLEAN LYCollapseBRs = COLLAPSE_BR_TAGS; /* Collapse serial BRs? */ PUBLIC BOOLEAN LYSetCookies = SET_COOKIES; /* Process Set-Cookie headers? */ +PUBLIC char *XLoadImageCommand = NULL; /* Default image viewer for X */ /* These are declared in cutil.h for current freeWAIS libraries. - FM */ #ifdef DECLARE_WAIS_LOGFILES @@ -323,6 +324,7 @@ PRIVATE BOOLEAN stack_dump = FALSE; PRIVATE char *terminal = NULL; PRIVATE char *pgm; PRIVATE BOOLEAN number_links = FALSE; +PRIVATE BOOLEAN LYPrependBase = FALSE; PRIVATE void parse_arg PARAMS((char **arg, int *i, int argc)); #ifndef VMS @@ -397,6 +399,7 @@ PRIVATE void free_lynx_globals NOARGS FREE(personal_mail_address); FREE(URLDomainPrefixes); FREE(URLDomainSuffixes); + FREE(XLoadImageCommand); for (i = 0; i < nlinks; i++) { FREE(links[i].lname); } @@ -479,6 +482,19 @@ PUBLIC int main ARGS2( AlertSecs = (int)ALERTSECS; StrAllocCopy(helpfile, HELPFILE); StrAllocCopy(startfile, STARTFILE); + LYTrimHead(startfile); + if (!strncasecomp(startfile, "lynxexec:", 9) || + !strncasecomp(startfile, "lynxprog:", 9)) { + /* + * The original implementions of these schemes expected + * white space without hex escaping, and did not check + * for hex escaping, so we'll continue to support that, + * until that code is redone in conformance with SGML + * principles. - FM + */ + HTUnEscapeSome(startfile, " \r\n\t"); + convert_to_spaces(startfile, TRUE); + } StrAllocCopy(jumpprompt, JUMP_PROMPT); #ifdef JUMPFILE StrAllocCopy(jumpfile, JUMPFILE); @@ -579,7 +595,7 @@ PUBLIC int main ARGS2( StrAllocCopy(LYLocalDomain, LOCAL_DOMAIN); StrAllocCopy(URLDomainPrefixes, URL_DOMAIN_PREFIXES); StrAllocCopy(URLDomainSuffixes, URL_DOMAIN_SUFFIXES); - + StrAllocCopy(XLoadImageCommand, XLOADIMAGE_COMMAND); /* * Set up the compilation default character set. - FM */ @@ -786,8 +802,22 @@ PUBLIC int main ARGS2( /* * Get WWW_HOME environment variable if it exists. */ - if ((cp = getenv("WWW_HOME")) != NULL) + if ((cp = getenv("WWW_HOME")) != NULL) { StrAllocCopy(startfile, cp); + LYTrimHead(startfile); + if (!strncasecomp(startfile, "lynxexec:", 9) || + !strncasecomp(startfile, "lynxprog:", 9)) { + /* + * The original implementions of these schemes expected + * white space without hex escaping, and did not check + * for hex escaping, so we'll continue to support that, + * until that code is redone in conformance with SGML + * principles. - FM + */ + HTUnEscapeSome(startfile, " \r\n\t"); + convert_to_spaces(startfile, TRUE); + } + } /* * Set the LynxHome URL. If it's a file URL and the @@ -1189,6 +1219,19 @@ PRIVATE void parse_arg ARGS3( */ if (argv[0][0] != '-') { StrAllocCopy(startfile, argv[0]); + LYTrimHead(startfile); + if (!strncasecomp(startfile, "lynxexec:", 9) || + !strncasecomp(startfile, "lynxprog:", 9)) { + /* + * The original implementions of these schemes expected + * white space without hex escaping, and did not check + * for hex escaping, so we'll continue to support that, + * until that code is redone in conformance with SGML + * principles. - FM + */ + HTUnEscapeSome(startfile, " \r\n\t"); + convert_to_spaces(startfile, TRUE); + } return; } @@ -1236,7 +1279,17 @@ PRIVATE void parse_arg ARGS3( break; case 'b': - if (strcmp(argv[0], "-book") == 0) { + if (strcmp(argv[0], "-base") == 0) { + /* + * Treat -source equivalently to an interactive + * download, so that a BASE tag is prepended for + * text/html content types. - FM + */ + LYPrependBase = TRUE; + if (HTOutputFormat == HTAtom_for("www/dump")) + HTOutputFormat = HTAtom_for("www/download"); + + } else if (strcmp(argv[0], "-book") == 0) { /* * Use bookmarks as startfile. */ @@ -1447,9 +1500,22 @@ PRIVATE void parse_arg ARGS3( historical_comments = TRUE; } else if (strncmp(argv[0], "-homepage", 9) == 0) { - if (nextarg) - StrAllocCopy(homepage,cp); - + if (nextarg) { + StrAllocCopy(homepage, cp); + LYTrimHead(homepage); + if (!strncasecomp(homepage, "lynxexec:", 9) || + !strncasecomp(homepage, "lynxprog:", 9)) { + /* + * The original implementions of these schemes expected + * white space without hex escaping, and did not check + * for hex escaping, so we'll continue to support that, + * until that code is redone in conformance with SGML + * principles. - FM + */ + HTUnEscapeSome(homepage, " \r\n\t"); + convert_to_spaces(homepage, TRUE); + } + } } else { goto Output_Error_and_Help_List; } @@ -1496,7 +1562,8 @@ PRIVATE void parse_arg ARGS3( */ keep_mime_headers = TRUE; dump_output_immediately = TRUE; - HTOutputFormat = HTAtom_for("www/dump"); + HTOutputFormat = (LYPrependBase ? + HTAtom_for("www/download") : HTAtom_for("www/dump")); LYcols=999; } else if (strncmp(argv[0], "-minimal", 11) == 0) { @@ -1776,7 +1843,8 @@ PRIVATE void parse_arg ARGS3( } else if (strncmp(argv[0], "-source", 7) == 0) { dump_output_immediately = TRUE; - HTOutputFormat = HTAtom_for("www/dump"); + HTOutputFormat = (LYPrependBase ? + HTAtom_for("www/download") : HTAtom_for("www/dump")); LYcols=999; } else if (strncmp(argv[0], "-stack_dump", 11) == 0) { @@ -1843,7 +1911,7 @@ PRIVATE void parse_arg ARGS3( parse_restrictions("all"); } else if (strncmp(argv[0], "-version", 8) == 0) { - printf("\n%s Version %s\n(c)1996 GNU General Public License\n\ + printf("\n%s Version %s\n(c)1997 GNU General Public License\n\ <URL:http://lynx.browser.org/>\n\n", LYNX_NAME, LYNX_VERSION); exit(0); @@ -1874,6 +1942,8 @@ Output_Help_List: printf(" in double-quotes (\"-\") on VMS)\n"); printf(" -anonymous used to specify the anonymous account\n"); printf(" -auth=id:pw authentication information for protected forms\n"); + printf(" -base prepend a request URL comment and BASE tag to text/html\n"); + printf(" outputs for -source or -mime_header dumps\n"); printf(" -book use the bookmark page as the startfile\n"); printf(" -buried_news toggles scanning of news articles for buried references\n"); printf(" -cache=NUMBER NUMBER of documents cached in memory (default is %d)\n",DEFAULT_CACHE_SIZE); diff --git a/src/LYMainLoop.c b/src/LYMainLoop.c index bce1652c..0cb80d9a 100644 --- a/src/LYMainLoop.c +++ b/src/LYMainLoop.c @@ -321,18 +321,23 @@ try_again: * Do any error logging, if appropriate. */ LYoverride_no_cache = FALSE; /* Was TRUE if popped. - FM */ - if (error_logging && !first_file && owner_address && - !LYCancelledFetch) { + if (error_logging && + first_file && owner_address && !LYCancelledFetch) { /* - * Send an error message. + * Email a bad link message to the owner of + * the document (but NOT to lynx-dev). - FM */ - if (!strncasecomp(owner_address, "mailto:", 7)) { - mailmsg(curdoc.link, - (owner_address+7), - history[nhist-1].address, - history[nhist-1].title); + if (strncasecomp(owner_address, "mailto:", 7)) { + if (strncasecomp((owner_address + 7), + "lynx-dev@", 9)) { + mailmsg(curdoc.link, + (owner_address+7), + history[nhist-1].address, + history[nhist-1].title); + } } - } else if (traversal && !first_file && !LYCancelledFetch) { + } + if (traversal && !first_file && !LYCancelledFetch) { FILE *ofp; if ((ofp = fopen(TRAVERSE_ERRORS,"a+")) == NULL) { @@ -2187,7 +2192,21 @@ check_recall: /* * Get rid of leading spaces (and any other spaces). */ - collapse_spaces(user_input_buffer); + LYTrimHead(user_input_buffer); + if (!strncasecomp(user_input_buffer, "lynxexec:", 9) || + !strncasecomp(user_input_buffer, "lynxprog:", 9)) { + /* + * The original implementions of these schemes expected + * white space without hex escaping, and did not check + * for hex escaping, so we'll continue to support that, + * until that code is redone in conformance with SGML + * principles. - FM + */ + HTUnEscapeSome(user_input_buffer, " \r\n\t"); + convert_to_spaces(user_input_buffer, TRUE); + } else { + collapse_spaces(user_input_buffer); + } if (*user_input_buffer == '\0' && !(recall && (ch == UPARROW || ch == DNARROW))) { strcpy(user_input_buffer, temp); @@ -3871,60 +3890,77 @@ check_add_bookmark_to_self: case LYK_JUMP: { - char *ret; - - if (no_jump || JThead == NULL) { - if (old_c != real_c) { - old_c = real_c; - if (no_jump) - _statusline(JUMP_DISALLOWED); - else - _statusline(NO_JUMPFILE); - sleep(MessageSecs); - } - } else { - LYJumpFileURL = TRUE; - if ((ret = LYJump(c)) != NULL) { + char *ret; + + if (no_jump || JThead == NULL) { + if (old_c != real_c) { + old_c = real_c; + if (no_jump) + _statusline(JUMP_DISALLOWED); + else + _statusline(NO_JUMPFILE); + sleep(MessageSecs); + } + } else { + LYJumpFileURL = TRUE; + if ((ret = LYJump(c)) != NULL) { #ifdef PERMIT_GOTO_FROM_JUMP - if (!strncasecomp(ret, "Go ", 3)) { - LYJumpFileURL = FALSE; - StrAllocCopy(temp, user_input_buffer); - URLTotal = (Goto_URLs ? HTList_count(Goto_URLs) : 0); - recall = ((URLTotal >= 1) ? RECALL : NORECALL); - URLNum = URLTotal; - FirstURLRecall = TRUE; - if (!strcasecomp(ret, "Go :")) { - if (recall) { - ch = UPARROW; - goto check_recall; - } - FREE(temp); - statusline(NO_RANDOM_URLS_YET); - sleep(MessageSecs); - break; - } - ret = HTParse((ret+3), startfile, PARSE_ALL); - strcpy(user_input_buffer, ret); - FREE(ret); - goto check_recall; - } + if (!strncasecomp(ret, "Go ", 3)) { + LYJumpFileURL = FALSE; + StrAllocCopy(temp, user_input_buffer); + URLTotal = (Goto_URLs ? + HTList_count(Goto_URLs) : 0); + recall = ((URLTotal >= 1) ? RECALL : NORECALL); + URLNum = URLTotal; + FirstURLRecall = TRUE; + if (!strcasecomp(ret, "Go :")) { + if (recall) { + ch = UPARROW; + goto check_recall; + } + FREE(temp); + statusline(NO_RANDOM_URLS_YET); + sleep(MessageSecs); + break; + } + ret = HTParse((ret+3), startfile, PARSE_ALL); + strcpy(user_input_buffer, ret); + FREE(ret); + goto check_recall; + } #endif /* PERMIT_GOTO_FROM_JUMP */ - ret = HTParse(ret, startfile, PARSE_ALL); - StrAllocCopy(newdoc.address, ret); - StrAllocCopy(lynxjumpfile, ret); - FREE(newdoc.post_data); - FREE(newdoc.post_content_type); - FREE(newdoc.bookmark); - newdoc.isHEAD = FALSE; - newdoc.safe = FALSE; - FREE(ret); - LYUserSpecifiedURL = TRUE; - } else { - LYJumpFileURL = FALSE; - } - } - break; + ret = HTParse(ret, startfile, PARSE_ALL); + LYTrimHead(ret); + if (!strncasecomp(ret, "lynxexec:", 9) || + !strncasecomp(ret, "lynxprog:", 9)) { + /* + * The original implementions of these schemes + * expected white space without hex escaping, + * and did not check for hex escaping, so we'll + * continue to support that, until that code is + * redone in conformance with SGML principles. + * - FM + */ + HTUnEscapeSome(ret, " \r\n\t"); + convert_to_spaces(ret, TRUE); + } else { + collapse_spaces(user_input_buffer); + } + StrAllocCopy(newdoc.address, ret); + StrAllocCopy(lynxjumpfile, ret); + FREE(newdoc.post_data); + FREE(newdoc.post_content_type); + FREE(newdoc.bookmark); + newdoc.isHEAD = FALSE; + newdoc.safe = FALSE; + FREE(ret); + LYUserSpecifiedURL = TRUE; + } else { + LYJumpFileURL = FALSE; + } + } } + break; #ifdef NOT_USED case LYK_VERSION: diff --git a/src/LYNews.c b/src/LYNews.c index eb1da221..b852e484 100644 --- a/src/LYNews.c +++ b/src/LYNews.c @@ -13,6 +13,7 @@ #include "LYHistory.h" #include "LYSystem.h" #include "GridText.h" +#include "LYSignal.h" #include "LYGlobalDefs.h" @@ -159,14 +160,20 @@ PUBLIC int LYNewsPost ARGS2(document *,newdoc, BOOLEAN,followup) #else fprintf(fd,"%s\n",user_input); - /* add Organization: */ - { FILE *fp; - - if (fp = fopen("/etc/organization", "r")) { - if (fgets(user_input, sizeof(user_input), fp) != NULL) - fprintf(fd, "Organization: %s", user_input); - fclose(fp); - } + /* + * Add Organization: header. + */ + { + FILE *fp; + char *org; + + if ((org = getenv("ORGANIZATION")) != NULL && *org != '\0') { + fprintf(fd, "Organization: %s\n", org); + } else if (fp = fopen("/etc/organization", "r")) { + if (fgets(user_input, sizeof(user_input), fp) != NULL) + fprintf(fd, "Organization: %s", user_input); + fclose(fp); + } } /* add Newsgroups: summary: and Keywords: */ @@ -260,6 +267,7 @@ PUBLIC int LYNewsPost ARGS2(document *,newdoc, BOOLEAN,followup) stop_curses(); printf("Posting your message:\n\n%s\n\nPlease wait...", cmd); system(cmd); + sleep(MessageSecs); start_curses(); /* come here to cleanup and exit */ diff --git a/src/LYReadCFG.c b/src/LYReadCFG.c index c0ede5b9..af340803 100644 --- a/src/LYReadCFG.c +++ b/src/LYReadCFG.c @@ -987,7 +987,7 @@ PUBLIC void read_cfg ARGS1( #endif /* VMS */ } else if (!strncasecomp(buffer, "USE_SELECT_POPUPS:", 18)) { - LYSelectPopups = is_true(buffer+18); + LYSelectPopups = is_true(buffer+18); } break; @@ -1043,6 +1043,12 @@ PUBLIC void read_cfg ARGS1( break; case 'W': + if (!strncasecomp(buffer, "XLOADIMAGE_COMMAND:", 19)) { + StrAllocCat(XLoadImageCommand, (char *)&buffer[19]); + } + break; + + case 'X': if (!strncasecomp(buffer, "wais_proxy:", 11)) { if (getenv("wais_proxy") == NULL) { #ifdef VMS diff --git a/src/LYUtils.c b/src/LYUtils.c index c003579e..c479d440 100644 --- a/src/LYUtils.c +++ b/src/LYUtils.c @@ -230,12 +230,15 @@ PUBLIC void collapse_spaces ARGS1( } /* - * Convert single or serial newlines to single spaces throughout a string - * (ignore newlines if the preceding character is a space) and convert - * tabs to single spaces (but don't ignore any explicit tabs or spaces). + * Convert single or serial newlines to single spaces throughout a string + * (ignore newlines if the preceding character is a space) and convert + * tabs to single spaces. Don't ignore any explicit tabs or spaces if + * the condense argument is FALSE, otherwise, condense any serial spaces + * or tabs to one space. - FM */ -PUBLIC void convert_to_spaces ARGS1( - char *, string) +PUBLIC void convert_to_spaces ARGS2( + char *, string, + BOOL, condense) { char *s = string; char *ns = string; @@ -248,7 +251,8 @@ PUBLIC void convert_to_spaces ARGS1( switch (*s) { case ' ': case '\t': - *(ns++) = ' '; + if (!(condense && last_is_space)) + *(ns++) = ' '; last_is_space = TRUE; break; @@ -347,7 +351,7 @@ PUBLIC void statusline ARGS1( /* * Deal with any newlines or tabs in the string. - FM */ - convert_to_spaces((char *)temp); + convert_to_spaces((char *)temp, FALSE); /* * Handle the Kanji, making sure the text is not @@ -382,7 +386,7 @@ PUBLIC void statusline ARGS1( /* * Deal with any newlines or tabs in the string. - FM */ - convert_to_spaces(buffer); + convert_to_spaces(buffer, FALSE); } /* diff --git a/src/LYUtils.h b/src/LYUtils.h index 05bdff41..b03b1c1d 100644 --- a/src/LYUtils.h +++ b/src/LYUtils.h @@ -11,7 +11,7 @@ extern void highlight PARAMS((int flag, int cur)); extern void free_and_clear PARAMS((char **obj)); extern void collapse_spaces PARAMS((char *string)); -extern void convert_to_spaces PARAMS((char *string)); +extern void convert_to_spaces PARAMS((char *string, BOOL condense)); extern char * strip_trailing_slash PARAMS((char * dirname)); extern void statusline PARAMS((char *text)); extern void toggle_novice_line NOPARAMS; diff --git a/src/LYVMSdef.h b/src/LYVMSdef.h new file mode 100644 index 00000000..35e3f577 --- /dev/null +++ b/src/LYVMSdef.h @@ -0,0 +1,18 @@ + +#ifndef LYVMSDEF_H +#define LYVMSDEF_H + +/* +** These are VMS system definitions which may not be in the headers +** of old VMS compilers and contain non-ANSI extended tokens that +** genterate warnings by some Unix compilers while looking for the +** "#endif" which closes the outer "#ifdef VMS". +*/ +#ifndef CLI$M_TRUSTED +#define CLI$M_TRUSTED 64 /* May not be in the compiler's clidef.h */ +#endif /* !CLI$M_TRUSTED */ +#ifndef LIB$_INVARG +#define LIB$_INVARG 1409588 /* May not be in the compiler's libdef.h */ +#endif /* !LIB$_INVARG */ + +#endif /* LYVMSDEF_H */ |