diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 1997-09-19 01:14:00 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 1997-09-19 01:14:00 -0400 |
commit | 443226a5ffcf805f6ab3ccbcc2a6b4802793b07d (patch) | |
tree | b6f0dca30c155e9ea2fa8ec78271fb44744b05ce | |
parent | d2e46bbfcbedb43938b866f4ad9e8bf1d4084b7c (diff) | |
download | lynx-snapshots-443226a5ffcf805f6ab3ccbcc2a6b4802793b07d.tar.gz |
snapshot of project "lynx", label v2-7-1ac_0-69
53 files changed, 397 insertions, 311 deletions
diff --git a/CHANGES.configure b/CHANGES.configure index 48c23106..9d446183 100644 --- a/CHANGES.configure +++ b/CHANGES.configure @@ -1,7 +1,5 @@ 97-09-17 -------- -* Undo misleading/incorrect use of 'const' in HTML.c, and associated - modules. - TD * merge symbols 'has_color' and 'lynx_has_color' to simplify ifdef's, and correct a problem building color-style configuration. - TD * add configure symbol for ifdef'ing presence of waitpid, which diff --git a/CHANGES.new b/CHANGES.new index 83a1516d..eccced77 100644 --- a/CHANGES.new +++ b/CHANGES.new @@ -10,9 +10,21 @@ README.configure), and miscellaneous other changes. Note that the 2.7 -> 2.7.1 changes (which are listed at the beginning of the current CHANGES file) are duplicated here. - KW] -97-09-17 -* Undo misleading/incorrect use of 'const' in HTML.c, and associated - modules. - TD +1997-09-18 +* Try again after interrupted waitpid() in LYLoadCGI(), as in LYExecv() - KW +* Tweak in LYKeymap.c to bypass the isalpha() test for non-ASCII values, + including values > 255 mapped to arrow keys, etc., when generating the + 'k'eymap display. - KW +* Changes to prevent many (but not all) compiler warnings about `const'. + Not that this is different from TD's recent changes. Also some other minor + tweaks relating to (gcc) compiler warnings. - KW +1997-09-17 +* Mods in GridText.c to use HTEscapeSP() for space-to-plus conversions of + name fields, and not just value fields, in submitted form content. Note + that some CGI scripts may still be doing plus-to-space restorations only + for value fields, and only hex unescaping for name fields, while others + may not be hex unescaping the name fields, so we may as well follow the + specs fully (and cross our fingers :). - KW & FM * merge symbols 'has_color' and 'lynx_has_color' to simplify ifdef's, and correct a problem building color-style configuration. - TD * add configure symbol for ifdef'ing presence of waitpid, which @@ -27,9 +39,14 @@ file) are duplicated here. - KW] * Add configure test for HP-UX -lHcurses library. - TD * Minor adjustments to names of configure-script variables, to make them the same as other programs (e.g., tin-unoff). - TD +1997-09-16 +* Added code to JKT's and KW's mods in LYPrint.c to also handle VMS: + set the document's title as a logical on VMS (can be accessed via + f$trnlnm("LYNX_PRINT_TITLE") in scripts). - FM +* Smaller cleanups here and there - FM & KW 97-09-15 * Recover from bad sequence "<=" in SGML.c by outputting those characters - litterally. - KW + literally. - KW * Try again after interrupted waitpid() in LYExecv(). - JED * Some tweaks in new DTD, some doc typo corrections. - KW 97-09-13 diff --git a/WWW/Library/Implementation/BSDI_Makefile b/WWW/Library/Implementation/BSDI_Makefile index 31f5dfef..21ff1c02 100644 --- a/WWW/Library/Implementation/BSDI_Makefile +++ b/WWW/Library/Implementation/BSDI_Makefile @@ -104,12 +104,12 @@ CERNLIBBIN = $(WWW)/bin COMMON = $(LOB)/HTParse.o $(LOB)/HTAccess.o $(LOB)/HTTP.o \ $(LOB)/HTFile.o $(LOB)/HTBTree.o $(LOB)/HTFTP.o $(LOB)/HTTCP.o \ $(LOB)/SGML.o $(LOB)/HTMLDTD.o $(LOB)/HTChunk.o \ - $(LOB)/HTPlain.o $(LOB)/HTWriter.o $(LOB)/HTFWriter.o \ + $(LOB)/HTPlain.o $(LOB)/HTWriter.o \ $(LOB)/HTMLGen.o \ $(LOB)/HTAtom.o $(LOB)/HTAnchor.o $(LOB)/HTStyle.o \ - $(LOB)/HTList.o $(LOB)/HTString.o $(LOB)/HTAlert.o \ - $(LOB)/HTRules.o $(LOB)/HTFormat.o $(LOB)/HTInit.o $(LOB)/HTMIME.o \ - $(LOB)/HTHistory.o $(LOB)/HTNews.o $(LOB)/HTGopher.o \ + $(LOB)/HTList.o $(LOB)/HTString.o \ + $(LOB)/HTRules.o $(LOB)/HTFormat.o $(LOB)/HTMIME.o \ + $(LOB)/HTHistory.o $(LOB)/HTNews.o $(LOB)/HTGopher.o \ $(LOB)/HTTelnet.o $(LOB)/HTFinger.o $(LOB)/HTWSRC.o $(HTWAIS) \ $(LOB)/HTAAUtil.o $(LOB)/HTAAServ.o $(LOB)/HTAABrow.o \ $(LOB)/HTAAFile.o $(LOB)/HTPasswd.o $(LOB)/HTGroup.o \ @@ -120,11 +120,11 @@ CFILES = $(CMN)HTParse.c $(CMN)HTAccess.c $(CMN)HTTP.c $(CMN)HTFile.c \ $(CMN)HTBTree.c \ $(CMN)HTFTP.c $(CMN)HTTCP.c $(CMN)SGML.c \ $(CMN)HTMLDTD.c \ - $(CMN)HTPlain.c $(CMN)HTWriter.c $(CMN)HTFWriter.c \ + $(CMN)HTPlain.c $(CMN)HTWriter.c \ $(CMN)HTMLGen.c \ $(CMN)HTChunk.c $(CMN)HTAtom.c $(CMN)HTAnchor.c $(CMN)HTStyle.c \ - $(CMN)HTList.c $(CMN)HTString.c $(CMN)HTAlert.c $(CMN)HTRules.c \ - $(CMN)HTFormat.c $(CMN)HTInit.c $(CMN)HTMIME.c $(CMN)HTHistory.c \ + $(CMN)HTList.c $(CMN)HTString.c $(CMN)HTRules.c \ + $(CMN)HTFormat.c $(CMN)HTMIME.c $(CMN)HTHistory.c \ $(CMN)HTNews.c $(CMN)HTGopher.c $(CMN)HTTelnet.c \ $(CMN)HTFinger.c $(CMN)HTWAIS.c $(CMN)HTWSRC.c \ $(CMN)HTAAUtil.c $(CMN)HTAAServ.c $(CMN)HTAABrow.c \ @@ -259,9 +259,6 @@ $(LOB)/HTAnchor.o : $(OE) $(CMN)HTAnchor.c $(CMN)HTUtils.h $(CMN)HTList.h $(LOB)/HTFormat.o : $(OE) $(CMN)HTFormat.c $(CMN)HTUtils.h $(CMN)HTList.h $(CC) -c -o $@ $(CFLAGS2) $(CMN)HTFormat.c -$(LOB)/HTInit.o : $(OE) $(CMN)HTInit.c $(CMN)HTUtils.h $(CMN)HTList.h - $(CC) -c -o $@ $(CFLAGS2) $(CMN)HTInit.c - $(LOB)/HTMIME.o : $(OE) $(CMN)HTMIME.c $(CMN)HTUtils.h $(CMN)HTList.h $(CC) -c -o $@ $(CFLAGS2) $(CMN)HTMIME.c @@ -295,14 +292,11 @@ $(LOB)/HTChunk.o : $(OE) $(CMN)HTChunk.c $(CMN)HTUtils.h $(LOB)/HTString.o : $(OE) $(CMN)HTString.c $(CMN)HTUtils.h $(CMN)Version.make $(CC) -c -o $@ $(CFLAGS2) -DVC=\"$(VC)\" $(CMN)HTString.c -$(LOB)/HTAlert.o : $(OE) $(CMN)HTAlert.c $(CMN)HTUtils.h $(CMN)Version.make - $(CC) -c -o $@ $(CFLAGS2) -DVC=\"$(VC)\" $(CMN)HTAlert.c - $(LOB)/HTRules.o : $(OE) $(CMN)HTRules.c $(CMN)HTUtils.h $(CMN)Version.make \ $(CMN)HTAAServ.h $(CMN)HTAAProt.h $(CC) -c -o $@ $(CFLAGS2) -DVC=\"$(VC)\" $(CMN)HTRules.c -$(LOB)/SGML.o : $(OE) $(CMN)SGML.c $(CMN)HTUtils.h +$(LOB)/SGML.o : $(OE) $(CMN)SGML.c $(CMN)HTUtils.h $(CMN)UCAux.h $(CC) -c -o $@ $(CFLAGS2) $(CMN)SGML.c $(LOB)/HTMLGen.o : $(OE) $(CMN)HTMLGen.c $(CMN)HTUtils.h $(CMN)HTMLDTD.h @@ -311,7 +305,8 @@ $(LOB)/HTMLGen.o : $(OE) $(CMN)HTMLGen.c $(CMN)HTUtils.h $(CMN)HTMLDTD.h $(LOB)/HTMLDTD.o : $(OE) $(CMN)HTMLDTD.c $(CMN)SGML.h $(CC) -c -o $@ $(CFLAGS2) $(CMN)HTMLDTD.c -$(LOB)/HTPlain.o : $(OE) $(CMN)HTPlain.c $(CMN)HTPlain.h $(CMN)HTStream.h +$(LOB)/HTPlain.o : $(OE) $(CMN)HTPlain.c $(CMN)HTPlain.h $(CMN)HTStream.h \ + $(CMN)UCAux.h $(CC) -c -o $@ $(CFLAGS2) $(CMN)HTPlain.c $(LOB)/HTWAIS.o : $(OE) $(CMN)HTWAIS.c $(CMN)HTUtils.h $(CMN)HTList.h @@ -323,9 +318,6 @@ $(LOB)/HTWSRC.o : $(OE) $(CMN)HTWSRC.c $(CMN)HTUtils.h $(CMN)HTList.h $(LOB)/HTWriter.o : $(OE) $(CMN)HTWriter.c $(CMN)HTWriter.h $(CMN)HTStream.h $(CC) -c -o $@ $(CFLAGS2) $(CMN)HTWriter.c -$(LOB)/HTFWriter.o : $(OE) $(CMN)HTFWriter.c $(CMN)HTFWriter.h $(CMN)HTStream.h - $(CC) -c -o $@ $(CFLAGS2) $(CMN)HTFWriter.c - # Access Authorization diff --git a/WWW/Library/Implementation/CommonMakefile b/WWW/Library/Implementation/CommonMakefile index 95a0c3a4..b7d32576 100644 --- a/WWW/Library/Implementation/CommonMakefile +++ b/WWW/Library/Implementation/CommonMakefile @@ -77,7 +77,7 @@ COMMON = $(LOB)/HTParse.o $(LOB)/HTAccess.o $(LOB)/HTTP.o \ $(LOB)/HTAtom.o $(LOB)/HTAnchor.o $(LOB)/HTStyle.o \ $(LOB)/HTList.o $(LOB)/HTString.o \ $(LOB)/HTRules.o $(LOB)/HTFormat.o $(LOB)/HTMIME.o \ - $(LOB)/HTHistory.o $(LOB)/HTNews.o $(LOB)/HTGopher.o \ + $(LOB)/HTHistory.o $(LOB)/HTNews.o $(LOB)/HTGopher.o \ $(LOB)/HTTelnet.o $(LOB)/HTFinger.o $(LOB)/HTWSRC.o $(HTWAIS) \ $(LOB)/HTAAUtil.o $(LOB)/HTAAServ.o $(LOB)/HTAABrow.o \ $(LOB)/HTAAFile.o $(LOB)/HTPasswd.o $(LOB)/HTGroup.o \ @@ -273,7 +273,8 @@ $(LOB)/HTMLGen.o : $(OE) $(CMN)HTMLGen.c $(CMN)HTUtils.h $(CMN)HTMLDTD.h $(LOB)/HTMLDTD.o : $(OE) $(CMN)HTMLDTD.c $(CMN)SGML.h $(CC) -c -o $@ $(CFLAGS2) $(CMN)HTMLDTD.c -$(LOB)/HTPlain.o : $(OE) $(CMN)HTPlain.c $(CMN)HTPlain.h $(CMN)HTStream.h $(CMN)UCAux.h +$(LOB)/HTPlain.o : $(OE) $(CMN)HTPlain.c $(CMN)HTPlain.h $(CMN)HTStream.h \ + $(CMN)UCAux.h $(CC) -c -o $@ $(CFLAGS2) $(CMN)HTPlain.c $(LOB)/HTWAIS.o : $(OE) $(CMN)HTWAIS.c $(CMN)HTUtils.h $(CMN)HTList.h diff --git a/WWW/Library/Implementation/HTAccess.c b/WWW/Library/Implementation/HTAccess.c index 0ebb2c17..816d64d2 100644 --- a/WWW/Library/Implementation/HTAccess.c +++ b/WWW/Library/Implementation/HTAccess.c @@ -600,7 +600,7 @@ PRIVATE BOOL HTLoadDocument ARGS4( { int status; HText * text; - char * address_to_load = (char *)full_address; + CONST char * address_to_load = full_address; extern char LYforce_no_cache; /* from GridText.c */ extern char LYoverride_no_cache; /* from LYMainLoop.c */ extern char * HTLoadedDocumentURL NOPARAMS; /* in GridText.c */ diff --git a/WWW/Library/Implementation/HTFTP.c b/WWW/Library/Implementation/HTFTP.c index f7a9a74f..3cf9dd3d 100644 --- a/WWW/Library/Implementation/HTFTP.c +++ b/WWW/Library/Implementation/HTFTP.c @@ -237,14 +237,15 @@ PUBLIC char * HTMake_VMS_name ARGS2( char *second; /* 2nd slash */ char *last; /* last slash */ - char * hostname = (char *)HTHostName(); + CONST char * hostname = HTHostName(); if (!filename || !nodename) outofmem(__FILE__, "HTVMSname"); strcpy(filename, fn); strcpy(nodename, ""); /* On same node? Yes if node names match */ if (strncmp(nn, "localhost", 9)) { - char *p, *q; + CONST char *p; + char *q; for (p = hostname, q = (char *)nn; *p && *p != '.' && *q && *q != '.'; p++, q++){ if (TOUPPER(*p) != TOUPPER(*q)) { @@ -757,7 +758,7 @@ PRIVATE int get_connection ARGS1( * Create and send a mail address as the password. - FM */ char *user = NULL; - char *host = NULL; + CONST char *host = NULL; char * cp; if (personal_mail_address && *personal_mail_address) { @@ -770,7 +771,7 @@ PRIVATE int get_connection ARGS1( *cp++ = '\0'; host = cp; } else { - host = (char *)HTHostName(); + host = HTHostName(); } } else { /* @@ -780,7 +781,7 @@ PRIVATE int get_connection ARGS1( StrAllocCopy(user, cp); else StrAllocCopy(user, "WWWuser"); - host = (char *)HTHostName(); + host = HTHostName(); } /* diff --git a/WWW/Library/Implementation/HTFile.c b/WWW/Library/Implementation/HTFile.c index c9fdfe9b..71ea8823 100644 --- a/WWW/Library/Implementation/HTFile.c +++ b/WWW/Library/Implementation/HTFile.c @@ -128,7 +128,7 @@ PUBLIC int HTDirReadme = HT_DIR_README_TOP; #endif /* DIRED_SUPPORT */ extern int current_char_set; -extern char *LYchar_set_names[]; +extern CONST char *LYchar_set_names[]; extern BOOL HTPassEightBitRaw; extern HTCJKlang HTCJK; #ifndef EXP_CHARTRANS @@ -865,7 +865,7 @@ PUBLIC HTFormat HTCharsetFormat ARGS3( UCT_STAGE_HTEXT, UCT_SETBY_DEFAULT); } - if (p_in->enc != UCT_ENC_CJK && + if ((p_in->enc != UCT_ENC_CJK) && (p_in->codepoints & UCT_CP_SUBSETOF_LAT1)) { HTCJK = NOCJK; } else if (chndl == current_char_set) { @@ -1892,19 +1892,25 @@ PUBLIC int HTLoadFile ARGS4( pathname = HTParse(logical, "", PARSE_PATH + PARSE_PUNCTUATION); - if (!strcmp(pathname,"/")) /* root path */ + if (!strcmp(pathname,"/")) { + /* + ** Root path. + */ StrAllocCopy (tail, "/foo/.."); - else { - char *p = strrchr(pathname, '/'); /* find lastslash */ + } else { + char *p = strrchr(pathname, '/'); /* find lastslash */ + if (!p) { /* - * This probably should not happen, but be - * prepared if it does... - kw - */ + ** This probably should not happen, + ** but be prepared if it does. - KW + */ StrAllocCopy (tail, "/foo/.."); } else { - /* take slash off the beginning */ - StrAllocCopy(tail, p+1); + /* + ** Take slash off the beginning. + */ + StrAllocCopy(tail, (p + 1)); } } FREE(pathname); diff --git a/WWW/Library/Implementation/HTFinger.c b/WWW/Library/Implementation/HTFinger.c index 4c3c4e94..d00b57cb 100644 --- a/WWW/Library/Implementation/HTFinger.c +++ b/WWW/Library/Implementation/HTFinger.c @@ -79,18 +79,19 @@ PRIVATE BOOL initialize NOARGS /* Start anchor element ** -------------------- */ -PRIVATE void start_anchor ARGS1(char *, href) +PRIVATE void start_anchor ARGS1(CONST char *, href) { BOOL present[HTML_A_ATTRIBUTES]; - char* value[HTML_A_ATTRIBUTES]; + CONST char* value[HTML_A_ATTRIBUTES]; { int i; for(i=0; i<HTML_A_ATTRIBUTES; i++) present[i] = (i==HTML_A_HREF); } - value[HTML_A_HREF] = href; - (*targetClass.start_element)(target, HTML_A, present, value, 0); + ((CONST char **)value)[HTML_A_HREF] = href; + (*targetClass.start_element)(target, HTML_A, present, + (CONST char **)value, 0); } diff --git a/WWW/Library/Implementation/HTGopher.c b/WWW/Library/Implementation/HTGopher.c index dd1a4662..7af74580 100644 --- a/WWW/Library/Implementation/HTGopher.c +++ b/WWW/Library/Implementation/HTGopher.c @@ -185,22 +185,23 @@ PUBLIC BOOLEAN HT_Is_Gopher_URL=FALSE; PRIVATE void write_anchor ARGS2(CONST char *,text, CONST char *,addr) { BOOL present[HTML_A_ATTRIBUTES]; - char * value[HTML_A_ATTRIBUTES]; + CONST char * value[HTML_A_ATTRIBUTES]; int i; for (i = 0; i < HTML_A_ATTRIBUTES; i++) present[i] = 0; present[HTML_A_HREF] = YES; - value[HTML_A_HREF] = addr; + ((CONST char **)value)[HTML_A_HREF] = addr; present[HTML_A_TITLE] = YES; - value[HTML_A_TITLE] = text; + ((CONST char **)value)[HTML_A_TITLE] = text; if(TRACE) fprintf(stderr,"HTGopher: adding URL: %s\n",addr); HT_Is_Gopher_URL = TRUE; /* tell HTML.c that this is a Gopher URL */ - (*targetClass.start_element)(target, HTML_A, present, value, 0); + (*targetClass.start_element)(target, HTML_A, present, + (CONST char **)value, 0); PUTS(text); END(HTML_A); @@ -1772,7 +1773,7 @@ PUBLIC int HTLoadGopher ARGS4( int len; if ((len = strlen(arg)) > 5) { - if (0 == strcmp((char *)&arg[len-6], ":105/2")) { + if (0 == strcmp(&arg[len-6], ":105/2")) { /* Use CSO gateway. */ if (TRACE) fprintf(stderr, "HTGopher: Passing to CSO/PH gateway.\n"); diff --git a/WWW/Library/Implementation/HTMIME.c b/WWW/Library/Implementation/HTMIME.c index 129cc846..db6d75b7 100644 --- a/WWW/Library/Implementation/HTMIME.c +++ b/WWW/Library/Implementation/HTMIME.c @@ -26,7 +26,7 @@ #define FREE(x) if (x) {free(x); x = NULL;} extern int current_char_set; -extern char *LYchar_set_names[]; +extern CONST char *LYchar_set_names[]; extern BOOL HTPassEightBitRaw; extern HTCJKlang HTCJK; @@ -442,8 +442,9 @@ PRIVATE void HTMIME_put_character ARGS2( UCT_STAGE_MIME), UCT_STAGE_HTEXT, UCT_SETBY_DEFAULT); } - if (p_in->enc != UCT_ENC_CJK && - (p_in->codepoints & UCT_CP_SUBSETOF_LAT1)){ + if ((p_in->enc != UCT_ENC_CJK) && + (p_in->codepoints & + UCT_CP_SUBSETOF_LAT1)) { HTCJK = NOCJK; } else if (chndl == current_char_set) { HTPassEightBitRaw = TRUE; @@ -2460,7 +2461,7 @@ PUBLIC int HTrjis ARGS2( */ /* * RJIS ( Recover JIS code from broken file ) - * @Header: rjis.c,v 0.2 92/09/04 takahasi Exp @ + * $Header: /usr/build/VCS/lynx/WWW/Library/Implementation/RCS/HTMIME.c,v 1.10 1997/09/19 01:14:00 klaus Exp $ * Copyright (C) 1992 1994 * Hironobu Takahashi (takahasi@tiny.or.jp) * diff --git a/WWW/Library/Implementation/HTMLDTD.c b/WWW/Library/Implementation/HTMLDTD.c index 3f6df848..7eb1d86b 100644 --- a/WWW/Library/Implementation/HTMLDTD.c +++ b/WWW/Library/Implementation/HTMLDTD.c @@ -1780,11 +1780,11 @@ struct _HTStructured { PUBLIC void HTStartAnchor ARGS3( HTStructured *, obj, - char *, name, - char *, href) + CONST char *, name, + CONST char *, href) { BOOL present[HTML_A_ATTRIBUTES]; - char * value[HTML_A_ATTRIBUTES]; + CONST char * value[HTML_A_ATTRIBUTES]; int i; for (i = 0; i < HTML_A_ATTRIBUTES; i++) @@ -1792,11 +1792,11 @@ PUBLIC void HTStartAnchor ARGS3( if (name && *name) { present[HTML_A_NAME] = YES; - value[HTML_A_NAME] = name; + value[HTML_A_NAME] = (CONST char *)name; } if (href) { present[HTML_A_HREF] = YES; - value[HTML_A_HREF] = href; + value[HTML_A_HREF] = (CONST char *)href; } (*obj->isa->start_element)(obj, HTML_A, present, value, 0); @@ -1808,7 +1808,7 @@ PUBLIC void HTStartIsIndex ARGS3( CONST char *, href) { BOOL present[HTML_ISINDEX_ATTRIBUTES]; - char * value[HTML_ISINDEX_ATTRIBUTES]; + CONST char * value[HTML_ISINDEX_ATTRIBUTES]; int i; for (i = 0; i < HTML_ISINDEX_ATTRIBUTES; i++) @@ -1816,11 +1816,11 @@ PUBLIC void HTStartIsIndex ARGS3( if (prompt && *prompt) { present[HTML_ISINDEX_PROMPT] = YES; - value[HTML_ISINDEX_PROMPT] = prompt; + value[HTML_ISINDEX_PROMPT] = (CONST char *)prompt; } if (href) { present[HTML_ISINDEX_HREF] = YES; - value[HTML_ISINDEX_HREF] = href; + value[HTML_ISINDEX_HREF] = (CONST char *)href; } (*obj->isa->start_element)(obj, HTML_ISINDEX , present, value, 0); diff --git a/WWW/Library/Implementation/HTMLDTD.h b/WWW/Library/Implementation/HTMLDTD.h index 45ed9a36..98816060 100644 --- a/WWW/Library/Implementation/HTMLDTD.h +++ b/WWW/Library/Implementation/HTMLDTD.h @@ -10,10 +10,6 @@ */ -#define HT_NON_BREAK_SPACE ((char)1) /* For now */ -#define HT_EM_SPACE ((char)2) -#define LY_SOFT_HYPHEN '\007' - #ifndef HTMLDTD_H #define HTMLDTD_H @@ -23,6 +19,19 @@ #include "SGML.h" /* +** Lynx internal character representations. +*/ +#ifndef HT_NON_BREAK_SPACE +#define HT_NON_BREAK_SPACE ((char)1) /* For now */ +#endif /* !HT_NON_BREAK_SPACE */ +#ifndef HT_EM_SPACE +#define HT_EM_SPACE ((char)2) /* For now */ +#endif /* !HT_EM_SPACE */ +#ifndef LY_SOFT_HYPHEN +#define LY_SOFT_HYPHEN ((char)7) +#endif /* !LY_SOFT_HYPHEN */ + +/* Element Numbers @@ -962,8 +971,8 @@ Start anchor element */ extern void HTStartAnchor PARAMS(( HTStructured * targetstream, - char * name, - char * href)); + CONST char * name, + CONST char * href)); /* diff --git a/WWW/Library/Implementation/HTMLGen.c b/WWW/Library/Implementation/HTMLGen.c index 3b593d06..e3ca3e9d 100644 --- a/WWW/Library/Implementation/HTMLGen.c +++ b/WWW/Library/Implementation/HTMLGen.c @@ -258,7 +258,7 @@ PRIVATE void HTMLGen_start_element ARGS5( HTStructured *, me, int, element_number, CONST BOOL*, present, - char **, value, + CONST char **, value, char **, insert) { int i; @@ -516,7 +516,7 @@ PUBLIC HTStream* HTPlainToHTML ARGS3( HTStructured* me = (HTStructured*)malloc(sizeof(*me)); if (me == NULL) outofmem(__FILE__, "PlainToHTML"); - me->isa = (HTStructuredClass*) &PlainToHTMLConversion; + me->isa = (CONST HTStructuredClass*) &PlainToHTMLConversion; /* * Copy pointers to routines for speed. diff --git a/WWW/Library/Implementation/HTNews.c b/WWW/Library/Implementation/HTNews.c index 1fce965d..bcf2993e 100644 --- a/WWW/Library/Implementation/HTNews.c +++ b/WWW/Library/Implementation/HTNews.c @@ -627,36 +627,38 @@ PRIVATE char * author_address ARGS1(char *,email) /* Start anchor element ** -------------------- */ -PRIVATE void start_anchor ARGS1(char *, href) +PRIVATE void start_anchor ARGS1(CONST char *, href) { BOOL present[HTML_A_ATTRIBUTES]; - char* value[HTML_A_ATTRIBUTES]; + CONST char* value[HTML_A_ATTRIBUTES]; { int i; for(i=0; i < HTML_A_ATTRIBUTES; i++) present[i] = (i == HTML_A_HREF); } - value[HTML_A_HREF] = href; - (*targetClass.start_element)(target, HTML_A, present, value, 0); + ((CONST char **)value)[HTML_A_HREF] = href; + (*targetClass.start_element)(target, HTML_A , present, + (CONST char **)value, 0); } /* Start link element ** ------------------ */ -PRIVATE void start_link ARGS2(char *, href, char *, rev) +PRIVATE void start_link ARGS2(CONST char *, href, CONST char *, rev) { BOOL present[HTML_LINK_ATTRIBUTES]; - char* value[HTML_LINK_ATTRIBUTES]; + CONST char* value[HTML_LINK_ATTRIBUTES]; { int i; for(i=0; i < HTML_LINK_ATTRIBUTES; i++) present[i] = (i == HTML_LINK_HREF || i == HTML_LINK_REV); } - value[HTML_LINK_HREF] = href; - value[HTML_LINK_REV] = rev; - (*targetClass.start_element)(target, HTML_LINK, present, value, 0); + ((CONST char **)value)[HTML_LINK_HREF] = href; + ((CONST char **)value)[HTML_LINK_REV] = rev; + (*targetClass.start_element)(target, HTML_LINK, present, + (CONST char **)value, 0); } /* Start list element @@ -665,16 +667,17 @@ PRIVATE void start_link ARGS2(char *, href, char *, rev) PRIVATE void start_list ARGS1(int, seqnum) { BOOL present[HTML_OL_ATTRIBUTES]; - char* value[HTML_OL_ATTRIBUTES]; + CONST char* value[HTML_OL_ATTRIBUTES]; char SeqNum[20]; int i; for (i = 0; i < HTML_OL_ATTRIBUTES; i++) present[i] = (i == HTML_OL_SEQNUM || i == HTML_OL_START); sprintf(SeqNum, "%d", seqnum); - value[HTML_OL_SEQNUM] = SeqNum; - value[HTML_OL_START] = SeqNum; - (*targetClass.start_element)(target, HTML_OL, present, value, 0); + ((CONST char **)value)[HTML_OL_SEQNUM] = SeqNum; + ((CONST char **)value)[HTML_OL_START] = SeqNum; + (*targetClass.start_element)(target, HTML_OL , present, + (CONST char **)value, 0); } /* Paste in an Anchor diff --git a/WWW/Library/Implementation/HTPlain.c b/WWW/Library/Implementation/HTPlain.c index 8c177625..a76616e5 100644 --- a/WWW/Library/Implementation/HTPlain.c +++ b/WWW/Library/Implementation/HTPlain.c @@ -30,7 +30,7 @@ extern HTStyleSheet * styleSheet; extern int current_char_set; -extern char * LYchar_set_names[]; +extern CONST char * LYchar_set_names[]; extern CONST char **LYCharSets[]; #ifdef EXP_CHARTRANS extern int LYlowest_eightbit[]; @@ -299,9 +299,9 @@ PRIVATE void HTPlain_write ARGS3(HTStream *, me, CONST char*, s, int, l) } } - if (me->T.trans_to_uni && (unsign_c >= 127 || - (unsign_c < 32 && unsign_c != 0 && - me->T.trans_C0_to_uni))) { + if (me->T.trans_to_uni && + (unsign_c >= 127 || + (unsign_c < 32 && unsign_c != 0 && me->T.trans_C0_to_uni))) { unsign_c = UCTransToUni(c_p, me->in_char_set); if (unsign_c > 0) { if (unsign_c < 256) { @@ -397,9 +397,9 @@ PRIVATE void HTPlain_write ARGS3(HTStream *, me, CONST char*, s, int, l) uck, (char)uck); } HText_appendCharacter(me->text, (char)(uck & 0xff)); - } else if (chk && (uck == -4 || - (me->T.repl_translated_C0 && - uck > 0 && uck <32)) && + } else if (chk && + (uck == -4 || + (me->T.repl_translated_C0 && uck > 0 && uck < 32)) && /* ** Not found; look for replacement string. */ diff --git a/WWW/Library/Implementation/HTTCP.c b/WWW/Library/Implementation/HTTCP.c index 06c9ff03..572cd36b 100644 --- a/WWW/Library/Implementation/HTTCP.c +++ b/WWW/Library/Implementation/HTTCP.c @@ -264,7 +264,7 @@ PUBLIC unsigned int HTCardinal ARGS3( char **, pp, unsigned int, max_value) { - int n; + unsigned int n; if ((**pp<'0') || (**pp>'9')) { /* Null string is error */ *pstatus = -3; /* No number where one expeceted */ return 0; diff --git a/WWW/Library/Implementation/HTTP.c b/WWW/Library/Implementation/HTTP.c index d5aef1e8..9c08a170 100644 --- a/WWW/Library/Implementation/HTTP.c +++ b/WWW/Library/Implementation/HTTP.c @@ -105,7 +105,7 @@ PUBLIC int HTLoadHTTP ARGS4 ( HTStream*, sink) { int s; /* Socket number for returned data */ - char *url = (char *)arg; /* The URL which get_physical() returned */ + CONST char *url = arg; /* The URL which get_physical() returned */ char *command = NULL; /* The whole command */ char *eol; /* End of line if found */ char *start_of_data; /* Start of body of reply */ @@ -1307,7 +1307,6 @@ Cookie2_continuation: if (TOUPPER(*cp) != 'L') { cp++; } else if (!strncasecomp(cp, "Location:", 9)) { - char *value = NULL; char *cp1 = NULL, *cp2 = NULL; cp += 9; /* diff --git a/WWW/Library/Implementation/SGML.c b/WWW/Library/Implementation/SGML.c index 139be069..e1f56166 100644 --- a/WWW/Library/Implementation/SGML.c +++ b/WWW/Library/Implementation/SGML.c @@ -284,14 +284,14 @@ PRIVATE BOOL put_special_unicodes ARGS2( long, code) { if (code == 160) { - PUTC(1); + PUTC(HT_NON_BREAK_SPACE); } else if (code==173) { - PUTC(7); + PUTC(LY_SOFT_HYPHEN); } else if (code == 8194 || code == 8195 || code == 8201) { /* ** ensp, emsp or thinsp. */ - PUTC(2); + PUTC(HT_EM_SPACE); } else if (code == 8211 || code == 8212) { /* ** ndash or mdash. @@ -350,17 +350,17 @@ PRIVATE void handle_entity ARGS2( ** filters instead of using HTML_put_string(). - FM */ if (!strcmp(s, "nbsp")) { - PUTC(1); + PUTC(HT_NON_BREAK_SPACE); FoundEntity = TRUE; return; } if (!strcmp(s, "ensp") || !strcmp(s, "emsp") || !strcmp(s, "thinsp")) { - PUTC(2); + PUTC(HT_EM_SPACE); FoundEntity = TRUE; return; } if (!strcmp(s, "shy")) { - PUTC(7); + PUTC(LY_SOFT_HYPHEN); FoundEntity = TRUE; return; } @@ -810,7 +810,7 @@ PRIVATE void start_element ARGS1( context->target, new_tag - context->dtd->tags, context->present, - context->value, /* coerce type for think c */ + (CONST char**) context->value, /* coerce type for think c */ (char **)&context->include); if (new_tag->contents != SGML_EMPTY) { /* i.e. tag not empty */ HTElement * N = (HTElement *)malloc(sizeof(HTElement)); @@ -977,7 +977,7 @@ PUBLIC void SGML_character ARGS2( HTChunk *string = context->string; CONST char * EntityName; extern int current_char_set; - extern char *LYchar_set_names[]; + extern CONST char *LYchar_set_names[]; extern CONST char * HTMLGetEntityName PARAMS((int i)); #ifdef EXP_CHARTRANS @@ -1086,7 +1086,9 @@ PUBLIC void SGML_character ARGS2( goto top1; } else if (unsign_c < 32 && unsign_c != 0 && context->T.trans_C0_to_uni) { - /* This else if may be too ugly to keep... - kw */ + /* + ** This else if may be too ugly to keep. - KW + */ if (context->T.trans_from_uni && (((clong = UCTransToUni(c, context->in_char_set)) >= 32) || (context->T.transp && @@ -1123,7 +1125,7 @@ PUBLIC void SGML_character ARGS2( StrAllocCat(context->recover, replace_buf + 1); } goto top0a; - } /* next line end of ugly stuff for C0 - kw */ + } /* Next line end of ugly stuff for C0. - KW */ } else { goto top0a; } @@ -1233,14 +1235,14 @@ top1: */ } else if (unsign_c == 160 && !(PASS8859SPECL || HTCJK != NOCJK)) { - PUTC(1); + PUTC(HT_NON_BREAK_SPACE); /* ** Convert 173 (shy) to Lynx special character if ** neither HTPassHighCtrlRaw nor HTCJK is set. - FM */ } else if (unsign_c == 173 && !(PASS8859SPECL || HTCJK != NOCJK)) { - PUTC(7); + PUTC(LY_SOFT_HYPHEN); #ifdef EXP_CHARTRANS } else if (context->T.use_raw_char_in && saved_char_in) { @@ -1266,13 +1268,13 @@ top1: PUTC(c); } else if (chk && ((uck == -4 || (context->T.repl_translated_C0 && - uck > 0 && uck <32))) && - /* - ** Not found; look for replacement string. - */ - (uck = UCTransUniCharStr(replace_buf,60, clong, - context->html_char_set, 0) >= 0 ) ) { - CONST char *p; + uck > 0 && uck < 32))) && + /* + ** Not found; look for replacement string. - KW + */ + (uck = UCTransUniCharStr(replace_buf,60, clong, + context->html_char_set, + 0) >= 0)) { /* ** No further tests for valididy - assume that whoever ** defined replacement strings knew what she was doing. @@ -1490,14 +1492,15 @@ top1: #ifdef EXP_CHARTRANS if (value == 160 || value == 173) { /* - ** We *always* should interpret this as Latin1 here! + ** We *always* should interpret these as Latin1 here! ** Output the Lynx special character for nbsp and ** then recycle the terminator or break. - FM */ - if (value == 160) - PUTC(1); - else /* 173 */ - PUTC(7); + if (value == 160) { + PUTC(HT_NON_BREAK_SPACE); + } else { + PUTC(LY_SOFT_HYPHEN); + } string->size = 0; context->isHex = FALSE; context->state = S_text; @@ -1510,21 +1513,26 @@ top1: */ if ((uck = UCTransUniChar(value,current_char_set)) >= 32 && uck < 256 && - (uck < 127 || - uck >= LYlowest_eightbit[context->html_char_set]) - ) { - if (uck==160 && current_char_set==0) - PUTC(1); /* would only happen if some other unicode - is mapped to Latin-1 160 */ - else if (uck==173 && current_char_set==0) - PUTC(7); /* would only happen if some other unicode - is mapped to Latin-1 173 */ - else { - PUTC(FROMASCII((char)uck)); - } - } else if ((uck == -4 || + (uck < 127 || + uck >= LYlowest_eightbit[context->html_char_set])) { + if (uck == 160 && current_char_set == 0) { + /* + ** Would only happen if some other unicode + ** is mapped to Latin-1 160. + */ + PUTC(HT_NON_BREAK_SPACE); + } else if (uck == 173 && current_char_set == 0) { + /* + ** Would only happen if some other unicode + ** is mapped to Latin-1 173. + */ + PUTC(LY_SOFT_HYPHEN); + } else { + PUTC(FROMASCII((char)uck)); + } + } else if ((uck == -4 || (context->T.repl_translated_C0 && - uck > 0 && uck <32)) && + uck > 0 && uck < 32)) && /* ** Not found; look for replacement string. */ @@ -1576,7 +1584,7 @@ top1: /* ** ensp, emsp or thinsp. - FM */ - PUTC(2); + PUTC(HT_EM_SPACE); } else if (value == 8211 || value == 8212) { /* ** ndash or mdash. - FM @@ -1606,12 +1614,12 @@ top1: /* ** Use Lynx special character for 160 (nbsp). - FM */ - PUTC(1); + PUTC(HT_NON_BREAK_SPACE); } else if (value == 173) { /* ** Use Lynx special character for 173 (shy) - FM */ - PUTC(7); + PUTC(LY_SOFT_HYPHEN); } else if (value < 161 || HTPassEightBitNum || !strncmp(LYchar_set_names[current_char_set], "ISO Latin 1", 11)) { @@ -1722,7 +1730,7 @@ top1: break; } else if (!string->size && (WHITE(c) || c == '=')) {/* <WHITE or <= */ /* - ** Recover the '<' and WHITE or '=' character. - FM, kw + ** Recover the '<' and WHITE or '=' character. - FM & KW */ context->state = S_text; PUTC('<'); diff --git a/WWW/Library/Implementation/SGML.h b/WWW/Library/Implementation/SGML.h index 4a0fbd76..42524cbe 100644 --- a/WWW/Library/Implementation/SGML.h +++ b/WWW/Library/Implementation/SGML.h @@ -206,7 +206,7 @@ typedef struct _HTStructuredClass{ HTStructured* me, int element_number, CONST BOOL* attribute_present, - char** attribute_value, + CONST char** attribute_value, char ** include)); void (*end_element) PARAMS(( diff --git a/WWW/Library/Implementation/UCDefs.h b/WWW/Library/Implementation/UCDefs.h index 53d56439..bbfdc33a 100644 --- a/WWW/Library/Implementation/UCDefs.h +++ b/WWW/Library/Implementation/UCDefs.h @@ -5,7 +5,7 @@ typedef struct _LYUCcharset { int UChndl; - char * MIMEname; + CONST char * MIMEname; int enc; int repertoire; int codepoints; diff --git a/lynx.cfg b/lynx.cfg index b6995eb2..5805a652 100644 --- a/lynx.cfg +++ b/lynx.cfg @@ -1358,10 +1358,10 @@ MINIMAL_COMMENTS:TRUE # vt100 Select Key: 0x10B # vt100 Insert Key: 0x10C # vt100 Remove Key: 0x10D -# (0x00) NULL KEY: 0x00E (DO_NOTHING) +# (0x00) NULL KEY: 0x10E (DO_NOTHING) # -#KEYMAP:0x2F:SOURCE # Toggle source viewing mode (show HTML source +#KEYMAP:0x2F:SOURCE # Toggle source viewing mode (show HTML source) #KEYMAP:^R:RELOAD # Reload the current document and redisplay #KEYMAP:q:QUIT # Ask the user to quit #KEYMAP:Q:ABORT # Quit without verification diff --git a/samples/lynx.cfg b/samples/lynx.cfg index 58f6a189..7a789fd9 100644 --- a/samples/lynx.cfg +++ b/samples/lynx.cfg @@ -1358,10 +1358,10 @@ MINIMAL_COMMENTS:TRUE # vt100 Select Key: 0x10B # vt100 Insert Key: 0x10C # vt100 Remove Key: 0x10D -# (0x00) NULL KEY: 0x00E (DO_NOTHING) +# (0x00) NULL KEY: 0x10E (DO_NOTHING) # -#KEYMAP:0x2F:SOURCE # Toggle source viewing mode (show HTML source +#KEYMAP:0x2F:SOURCE # Toggle source viewing mode (show HTML source) #KEYMAP:^R:RELOAD # Reload the current document and redisplay #KEYMAP:q:QUIT # Ask the user to quit #KEYMAP:Q:ABORT # Quit without verification diff --git a/src/GridText.c b/src/GridText.c index 301d2a18..77d23ac1 100644 --- a/src/GridText.c +++ b/src/GridText.c @@ -5018,8 +5018,8 @@ PUBLIC void www_user_search ARGS3( } PUBLIC void user_message ARGS2( - char *, message, - char *, argument) + CONST char *, message, + CONST char *, argument) { char *temp = NULL; char temp_arg[256]; @@ -5962,7 +5962,7 @@ PUBLIC int HText_beginInput ARGS3( TextAnchor * a = (TextAnchor *) calloc(1, sizeof(*a)); FormInfo * f = (FormInfo *) calloc(1, sizeof(*f)); - char *cp_option = NULL; + CONST char *cp_option = NULL; char *IValue = NULL; unsigned char *tmp = NULL; int i, j; @@ -6633,7 +6633,7 @@ PUBLIC void HText_SubmitForm ARGS4( StrAllocCat(escaped1, MultipartContentType); StrAllocCat(escaped1, "\r\n\r\n"); } else { - escaped1 = HTEscape(form_ptr->name,URL_XALPHAS); + escaped1 = HTEscapeSP(form_ptr->name,URL_XALPHAS); } /* @@ -6772,7 +6772,7 @@ PUBLIC void HText_SubmitForm ARGS4( StrAllocCat(escaped1, MultipartContentType); StrAllocCat(escaped1, "\r\n\r\n"); } else { - escaped1 = HTEscape(form_ptr->name, URL_XALPHAS); + escaped1 = HTEscapeSP(form_ptr->name, URL_XALPHAS); } /* * Be sure to use the submit option value. @@ -6900,7 +6900,7 @@ PUBLIC void HText_SubmitForm ARGS4( StrAllocCat(escaped1, MultipartContentType); StrAllocCat(escaped1, "\r\n\r\n"); } else { - escaped1 = HTEscape(form_ptr->name, URL_XALPHAS); + escaped1 = HTEscapeSP(form_ptr->name, URL_XALPHAS); } sprintf(&query[strlen(query)], "%s%s%s%s%s", @@ -6982,7 +6982,7 @@ PUBLIC void HText_SubmitForm ARGS4( StrAllocCat(escaped1, MultipartContentType); StrAllocCat(escaped1, "\r\n\r\n"); } else { - escaped1 = HTEscape(form_ptr->name, URL_XALPHAS); + escaped1 = HTEscapeSP(form_ptr->name, URL_XALPHAS); } /* diff --git a/src/GridText.h b/src/GridText.h index fbd8455d..0e6080e6 100644 --- a/src/GridText.h +++ b/src/GridText.h @@ -14,7 +14,9 @@ #define LY_UNDERLINE_END_CHAR '\004' #define LY_BOLD_START_CHAR '\005' #define LY_BOLD_END_CHAR '\006' -#define LY_SOFT_HYPHEN '\007' +#ifndef LY_SOFT_HYPHEN +#define LY_SOFT_HYPHEN ((char)7) +#endif /* !LY_SOFT_HYPHEN */ #define IsSpecialAttrChar(a) ((a > '\002') && (a < '\010')) extern int HTCurSelectGroupType; @@ -163,7 +165,7 @@ extern HTList * search_queries; /* Previous isindex and whereis queries */ extern void HTSearchQueries_free NOPARAMS; extern void HTAddSearchQuery PARAMS((char *query)); -extern void user_message PARAMS((char * message, char * argument)); +extern void user_message PARAMS((CONST char * message, CONST char * argument)); #define _user_message(msg, arg) mustshow = TRUE, user_message(msg, arg) diff --git a/src/HTAlert.c b/src/HTAlert.c index 93fb0fed..a83014db 100644 --- a/src/HTAlert.c +++ b/src/HTAlert.c @@ -32,13 +32,13 @@ PUBLIC void HTAlert ARGS1( CONST char *, Msg) { if (TRACE) { - fprintf(stderr, "\nAlert!: %s", (char *)Msg); + fprintf(stderr, "\nAlert!: %s", Msg); fflush(stderr); - _user_message("Alert!: %s", (char *)Msg); + _user_message("Alert!: %s", Msg); fprintf(stderr, "\n\n"); fflush(stderr); } else - _user_message("Alert!: %s", (char *)Msg); + _user_message("Alert!: %s", Msg); sleep(AlertSecs); } @@ -50,9 +50,9 @@ PUBLIC void HTProgress ARGS1( CONST char *, Msg) { if (TRACE) - fprintf(stderr, "%s\n", (char *)Msg); + fprintf(stderr, "%s\n", Msg); else - statusline((char *)Msg); + statusline(Msg); } /* Seek confirmation. HTConfirm() @@ -68,7 +68,7 @@ PUBLIC BOOL HTConfirm ARGS1(CONST char *, Msg) extern BOOLEAN HadVMSInterrupt; #endif /* VMS */ - _user_message("%s (y/n) ", (char *)Msg); + _user_message("%s (y/n) ", Msg); while (1) { c = LYgetch(); @@ -99,7 +99,7 @@ PUBLIC char * HTPrompt ARGS2( Tmp[0] = '\0'; Tmp[199] = '\0'; - _statusline((char *)Msg); + _statusline(Msg); if (deflt) strncpy(Tmp, deflt, 199); @@ -124,7 +124,7 @@ PUBLIC char * HTPromptPassword ARGS1( pw[0] = '\0'; if (!dump_output_immediately) { - _statusline(Msg ? (char *)Msg : PASSWORD_PROMPT); + _statusline(Msg ? Msg : PASSWORD_PROMPT); LYgetstr(pw, HIDDEN, sizeof(pw), NORECALL); /* hidden */ StrAllocCopy(result, pw); } else { diff --git a/src/HTFWriter.c b/src/HTFWriter.c index a5dd12a5..3c3e45aa 100644 --- a/src/HTFWriter.c +++ b/src/HTFWriter.c @@ -237,15 +237,17 @@ PRIVATE void HTFWriter_free ARGS1(HTStream *, me) } FREE(path); #ifdef EXP_CHARTRANS - /* - * Lock the chartrans info we may possibly have, - * so HTCharsetFormat() will not apply the default - * for local files. - KW - */ if (!skip_loadfile) { + /* + * Lock the chartrans info we may possibly have, + * so HTCharsetFormat() will not apply the default + * for local files. - KW + */ if (HTAnchor_getUCLYhndl(me->anchor, UCT_STAGE_PARSER) < 0 ) { - /* If not yet set - kw */ + /* + * If not yet set - KW + */ HTAnchor_copyUCInfoStage(me->anchor, UCT_STAGE_PARSER, UCT_STAGE_MIME, diff --git a/src/HTFont.h b/src/HTFont.h index 9ab44fd5..61ece860 100644 --- a/src/HTFont.h +++ b/src/HTFont.h @@ -8,8 +8,12 @@ typedef long int HTMLFont; /* For now */ +#ifndef HT_NON_BREAK_SPACE #define HT_NON_BREAK_SPACE ((char)1) /* For now */ +#endif /* !HT_NON_BREAK_SPACE */ +#ifndef HT_EM_SPACE #define HT_EM_SPACE ((char)2) /* For now */ +#endif /* !HT_EM_SPACE */ #define HT_FONT 0 diff --git a/src/HTForms.h b/src/HTForms.h index c152f0a9..9f2503b0 100644 --- a/src/HTForms.h +++ b/src/HTForms.h @@ -15,25 +15,25 @@ extern int change_form_link PARAMS((struct link *form_link, int mode, * HTML.c and Gridtext.c in HText_beginInput() */ typedef struct _InputFieldData { - char *accept; - char *align; + CONST char *accept; + CONST char *align; int checked; - char *class; + CONST char *class; int disabled; - char *error; - char *height; - char *id; - char *lang; - char *max; - char *maxlength; - char *md; - char *min; - char *name; - char *size; - char *src; - char *type; + CONST char *error; + CONST char *height; + CONST char *id; + CONST char *lang; + CONST char *max; + CONST char *maxlength; + CONST char *md; + CONST char *min; + CONST char *name; + CONST char *size; + CONST char *src; + CONST char *type; char *value; - char *width; + CONST char *width; } InputFieldData; /* The OptionType structure is for a linked list of option entries diff --git a/src/HTML.c b/src/HTML.c index ebe3162e..eb09a0f9 100644 --- a/src/HTML.c +++ b/src/HTML.c @@ -520,7 +520,7 @@ char prevailing_class[TEMPSTRINGSIZE]; int hcode; #endif -#define CHECK_ID(code) LYCheckForID(me, present, (CONST char **)value, (int)code) +#define CHECK_ID(code) LYCheckForID(me, present, value, (int)code) /* Start Element ** ------------- @@ -529,7 +529,7 @@ PRIVATE void HTML_start_element ARGS5( HTStructured *, me, int, element_number, CONST BOOL*, present, - char **, value, + CONST char **, value, char **, include) { char *alt_string = NULL; @@ -595,14 +595,14 @@ PRIVATE void HTML_start_element ARGS5( fprintf(stderr, " (undefined) %s\n", myHash); if (rp) { - int hcode; + int hcd; *rp='\0'; /* trim the class */ - hcode=hash_code(myHash); - fprintf(stderr, "CSS:%s -> %d", myHash, hcode); - if (hashStyles[hcode].code!=hcode) + hcd = hash_code(myHash); + fprintf(stderr, "CSS:%s -> %d", myHash, hcd); + if (hashStyles[hcd].code!=hcd) fprintf(stderr, " (undefined) %s\n", myHash); else - fprintf(stderr, " ca=%d\n", hashStyles[hcode].color); + fprintf(stderr, " ca=%d\n", hashStyles[hcd].color); } } else @@ -4193,9 +4193,9 @@ PRIVATE void HTML_start_element ARGS5( if (current_char_set) { LYExpandString((char **)&value[HTML_BUTTON_VALUE]); } - LYUnEscapeEntities(value[HTML_BUTTON_VALUE], + LYUnEscapeEntities((char *)value[HTML_BUTTON_VALUE], me->UsePlainSpace, me->HiddenValue); - I.value = value[HTML_BUTTON_VALUE]; + I.value = (char *)value[HTML_BUTTON_VALUE]; /* * Convert any newlines or tabs to spaces, * and trim any lead or trailing spaces. - FM @@ -4513,12 +4513,12 @@ PRIVATE void HTML_start_element ARGS5( (char **)&value[HTML_INPUT_ALT] : (char **)&value[HTML_INPUT_VALUE])); LYUnEscapeEntities(((UseALTasVALUE == TRUE) ? - value[HTML_INPUT_ALT] : - value[HTML_INPUT_VALUE]), + (char *)value[HTML_INPUT_ALT] : + (char *)value[HTML_INPUT_VALUE]), me->UsePlainSpace, me->HiddenValue); I.value = ((UseALTasVALUE == TRUE) ? - value[HTML_INPUT_ALT] : - value[HTML_INPUT_VALUE]); + (char *)value[HTML_INPUT_ALT] : + (char *)value[HTML_INPUT_VALUE]); if (me->UsePlainSpace == TRUE) { /* * Convert any newlines or tabs to spaces, @@ -5016,7 +5016,7 @@ PRIVATE void HTML_start_element ARGS5( LYUseDefaultRawMode = TRUE; HTMLSetCharacterHandling(current_char_set); } - LYUnEscapeEntities(value[HTML_OPTION_VALUE], + LYUnEscapeEntities((char *)value[HTML_OPTION_VALUE], me->UsePlainSpace, me->HiddenValue); if (CurrentCharSet) { current_char_set = CurrentCharSet; @@ -5026,7 +5026,7 @@ PRIVATE void HTML_start_element ARGS5( HTCJK = CurrentHTCJK; } - I.value = value[HTML_OPTION_VALUE]; + I.value = (char *)value[HTML_OPTION_VALUE]; } if (me->select_disabled || diff --git a/src/LYCgi.c b/src/LYCgi.c index 44a85bd4..86d2db58 100644 --- a/src/LYCgi.c +++ b/src/LYCgi.c @@ -271,6 +271,12 @@ PRIVATE int LYLoadCGI ARGS4( strcmp(arg, HTLoadedDocumentURL()) && HText_AreDifferent(anAnchor, arg) && HTLoadedDocumentBookmark()) { + /* + * If we are reloading a lynxcgi document that had already been + * loaded, the various checks above should allow it even if + * no_bookmark_exec is TRUE an we are not now coming from a + * bookmark page. - kw + */ _statusline(BOOKMARK_EXEC_DISABLED); sleep(MessageSecs); status = HT_NOT_LOADED; @@ -281,6 +287,12 @@ PRIVATE int LYLoadCGI ARGS4( HText_AreDifferent(anAnchor, arg) && !exec_ok(HTLoadedDocumentURL(), pgm, CGI_PATH)) { /* exec_ok gives out msg. */ + /* + * If we are reloading a lynxcgi document that had already been + * loaded, the various checks above should allow it even if + * exec_ok() would reject it because we are not now coming from + * a document with a URL allowed by TRUSTED_LYNXCGI rules. - kw + */ status = HT_NOT_LOADED; } else { @@ -380,8 +392,18 @@ PRIVATE int LYLoadCGI ARGS4( while (wait(&wstatus) != pid) ; /* do nothing */ #else - waitpid(pid, &wstatus, 0); /* wait for child */ -#endif + while (-1 == waitpid(pid, &wstatus, 0)) { /* wait for child */ +#ifdef EINTR + if (errno == EINTR) + continue; +#endif /* EINTR */ +#ifdef ERESTARTSYS + if (errno == ERESTARTSYS) + continue; +#endif /* ERESTARTSYS */ + break; + } +#endif /* HAVE_TYPE_UNIONWAIT && !HAVE_WAITPID */ if (anAnchor->post_data) { close(fd1[1]); } diff --git a/src/LYCharSets.c b/src/LYCharSets.c index b7c84b9d..44e9cbaa 100644 --- a/src/LYCharSets.c +++ b/src/LYCharSets.c @@ -2069,7 +2069,7 @@ PUBLIC char ** LYCharSets[MAXCHARSETS]={ * Add the name that the user will see below. * The order of LYCharSets and char_set_names MUST be the same */ -PUBLIC char * LYchar_set_names[MAXCHARSETSP]={ +PUBLIC CONST char * LYchar_set_names[MAXCHARSETSP]={ "ISO Latin 1 ", "ISO Latin 2 ", "Other ISO Latin ", diff --git a/src/LYCharSets.h b/src/LYCharSets.h index f6e0f8a5..48a0c53a 100644 --- a/src/LYCharSets.h +++ b/src/LYCharSets.h @@ -4,7 +4,7 @@ /* LYchar_set_name[current_char_set] points to the currently active set */ extern int current_char_set; -extern char *LYchar_set_names[]; +extern CONST char *LYchar_set_names[]; extern char ** LYCharSets[]; diff --git a/src/LYCharUtils.c b/src/LYCharUtils.c index d7729cf4..3f55f204 100644 --- a/src/LYCharUtils.c +++ b/src/LYCharUtils.c @@ -798,7 +798,7 @@ PUBLIC void LYZero_OL_Counter ARGS1( #ifdef EXP_CHARTRANS /* -** This function is used by the HTML Structured object. - kw +** This function is used by the HTML Structured object. - KW */ PUBLIC void LYGetChartransInfo ARGS1( HTStructured *, me) @@ -1379,9 +1379,9 @@ PUBLIC char * LYUnEscapeEntities ARGS3( p++; } else if (!hidden && *p == 10 && q != str && *(q-1) == 13) { /* - * If this is not a hidden string, and the current char - * is the LF ('\n') of a CRLF pair, drop the CR ('\r'). - kw - */ + ** If this is not a hidden string, and the current char is + ** the LF ('\n') of a CRLF pair, drop the CR ('\r'). - KW + */ *(q-1) = *p++; } else { *q++ = *p++; @@ -2005,7 +2005,7 @@ PUBLIC void LYHandleMETA ARGS4( UCT_STAGE_HTEXT, UCT_SETBY_DEFAULT); } - if (p_in->enc != UCT_ENC_CJK && + if ((p_in->enc != UCT_ENC_CJK) && (p_in->codepoints & UCT_CP_SUBSETOF_LAT1)) { HTCJK = NOCJK; } else if (chndl == current_char_set) { @@ -2778,7 +2778,7 @@ PUBLIC void LYCheckForContentBase ARGS1( { char *cp = NULL; BOOL present[HTML_BASE_ATTRIBUTES]; - char *value[HTML_BASE_ATTRIBUTES]; + CONST char *value[HTML_BASE_ATTRIBUTES]; int i; if (!(me && me->node_anchor)) @@ -2831,7 +2831,7 @@ PUBLIC void LYCheckForContentBase ARGS1( for (i = 0; i < HTML_BASE_ATTRIBUTES; i++) present[i] = NO; present[HTML_BASE_HREF] = YES; - value[HTML_BASE_HREF] = cp; + value[HTML_BASE_HREF] = (CONST char *)cp; (*me->isa->start_element)(me, HTML_BASE, present, value, 0); FREE(cp); } diff --git a/src/LYCookie.c b/src/LYCookie.c index 67ddd131..284df163 100644 --- a/src/LYCookie.c +++ b/src/LYCookie.c @@ -121,7 +121,7 @@ PRIVATE void MemAllocCopy ARGS3( temp = (char *)calloc(1, ((end - start) + 1)); if (temp == NULL) outofmem(__FILE__, "MemAllocCopy"); - LYstrncpy(temp, (char *)start, (end - start)); + LYstrncpy(temp, start, (end - start)); HTSACopy(dest, temp); FREE(temp); } @@ -238,7 +238,7 @@ PRIVATE BOOLEAN port_matches ARGS2( int, port, CONST char *, list) { - char *number = (char *)list; + CONST char *number = list; if (!(number && isdigit(*number))) return(FALSE); @@ -897,7 +897,7 @@ PRIVATE void LYProcessSetCookies ARGS6( value = (char *)calloc(1, value_len + 1); if (value == NULL) outofmem(__FILE__, "LYProcessSetCookies"); - LYstrncpy(value, (char *)value_start, value_len); + LYstrncpy(value, value_start, value_len); } if (len == 6 && !strncasecomp(attr_start, "secure", 6)) { if (value == NULL) { @@ -1395,7 +1395,7 @@ PRIVATE void LYProcessSetCookies ARGS6( value = (char *)calloc(1, value_len + 1); if (value == NULL) outofmem(__FILE__, "LYProcessSetCookie"); - LYstrncpy(value, (char *)value_start, value_len); + LYstrncpy(value, value_start, value_len); } if (len == 6 && !strncasecomp(attr_start, "secure", 6)) { if (value == NULL) { diff --git a/src/LYCurses.c b/src/LYCurses.c index f609100e..c3fc98ae 100644 --- a/src/LYCurses.c +++ b/src/LYCurses.c @@ -38,7 +38,7 @@ extern int _NOSHARE(COLS); #endif #if defined(COLOR_CURSES) -int lynx_uses_color = 0; +int lynx_has_color = 0; #endif /* @@ -211,7 +211,7 @@ PRIVATE int LYAttrset ARGS3(WINDOW*,win,int,color,int,mono) { if (TRACE) fprintf(stderr, "CSS:LYAttrset (%d, %d)\n", color, mono); - if (lynx_uses_color && LYShowColor >= SHOW_COLOR_ON && color > -1) + if (lynx_has_color && LYShowColor >= SHOW_COLOR_ON && color > -1) { wattrset(win,color); #if 0 @@ -393,7 +393,7 @@ PRIVATE struct { */ PRIVATE void LYsetWAttr ARGS1(WINDOW *, win) { - if (lynx_uses_color && LYShowColor >= SHOW_COLOR_ON) { + if (lynx_has_color && LYShowColor >= SHOW_COLOR_ON) { int code = 0; int attr = A_NORMAL; int offs = 1; @@ -489,7 +489,7 @@ PUBLIC int lynx_chg_color ARGS3( PUBLIC void lynx_set_color ARGS1(int, a) { - if (lynx_uses_color && LYShowColor >= SHOW_COLOR_ON) { + if (lynx_has_color && LYShowColor >= SHOW_COLOR_ON) { attrset(lynx_color_cfg[a].attr | COLOR_PAIR(a+1)); } } @@ -504,12 +504,12 @@ PUBLIC void lynx_standout ARGS1(int, flag) PRIVATE void lynx_init_colors NOARGS { - lynx_uses_color = FALSE; + lynx_has_color = FALSE; if (has_colors()) { int n, m; - lynx_uses_color = TRUE; + lynx_has_color = TRUE; start_color(); for (n = 0; n < sizeof(lynx_color_cfg)/sizeof(lynx_color_cfg[0]); n++) { @@ -704,8 +704,8 @@ PUBLIC void start_curses NOARGS #endif #ifdef USE_COLOR_STYLE - lynx_uses_color = has_colors(); - if (lynx_uses_color) + lynx_has_color = has_colors(); + if (lynx_has_color) start_color(); parse_userstyles(); #endif @@ -1602,7 +1602,7 @@ PUBLIC void lynx_start_link_color ARGS2( start_underline (); #endif /* USE_SLANG */ #if defined(FANCY_CURSES) && defined(COLOR_CURSES) - if (lynx_uses_color && LYShowColor >= SHOW_COLOR_ON) + if (lynx_has_color && LYShowColor >= SHOW_COLOR_ON) start_underline (); #endif /* USE_SLANG */ } else { @@ -1630,7 +1630,7 @@ PUBLIC void lynx_stop_link_color ARGS2( stop_underline (); #endif /* USE_SLANG */ #if defined(FANCY_CURSES) && defined(COLOR_CURSES) - if (lynx_uses_color && LYShowColor >= SHOW_COLOR_ON) + if (lynx_has_color && LYShowColor >= SHOW_COLOR_ON) stop_underline (); #endif /* USE_SLANG */ } else { @@ -1663,7 +1663,7 @@ PUBLIC void lynx_start_target_color NOARGS PUBLIC void lynx_start_status_color NOARGS { #if USE_COLOR_TABLE && defined(COLOR_CURSES) - if (lynx_uses_color && LYShowColor >= SHOW_COLOR_ON) + if (lynx_has_color && LYShowColor >= SHOW_COLOR_ON) lynx_set_color (2); else #endif @@ -1673,7 +1673,7 @@ PUBLIC void lynx_start_status_color NOARGS PUBLIC void lynx_stop_status_color NOARGS { #if USE_COLOR_TABLE && defined(COLOR_CURSES) - if (lynx_uses_color && LYShowColor >= SHOW_COLOR_ON) + if (lynx_has_color && LYShowColor >= SHOW_COLOR_ON) lynx_set_color (0); else #endif diff --git a/src/LYGetFile.c b/src/LYGetFile.c index bea7d19a..17c3e31f 100644 --- a/src/LYGetFile.c +++ b/src/LYGetFile.c @@ -472,7 +472,7 @@ Try_Redirected_URL: ((HTMainAnchor && !LYUserSpecifiedURL) ? (char *)HTMainAnchor->address : (char *)doc->address), - (char *)title); + title); } return(NULLFILE); diff --git a/src/LYKeymap.c b/src/LYKeymap.c index d3dee733..1ffddd5e 100644 --- a/src/LYKeymap.c +++ b/src/LYKeymap.c @@ -520,7 +520,7 @@ PRIVATE char *pretty ARGS1 (int, c) sprintf(buf, "> "); else if (c == 0177) sprintf(buf, "<delete> "); - else if (c > ' ' && c < 0377) + else if (c > ' ' && c <= 0377) sprintf(buf, "%c", c); else if (c < ' ') sprintf(buf, "^%c", c|0100); @@ -589,7 +589,7 @@ PRIVATE int LYLoadKeymap ARGS4 ( } for (i = 1; i < sizeof(keymap); i++) { /* LYK_PIPE not implemented yet */ - if (!isalpha(i-1) && + if ((i > 127 || i <= ' ' || !isalpha(i-1)) && strcmp(revmap[(unsigned char)keymap[i]].name, "PIPE")) { print_binding(target, buf, i); } diff --git a/src/LYList.c b/src/LYList.c index 2dc43fe0..c9a4faa7 100644 --- a/src/LYList.c +++ b/src/LYList.c @@ -260,7 +260,7 @@ PUBLIC void printlist ARGS2( address = HTAnchor_address(dest); fprintf(fp, "%4d. %s%s\n", cnt, ((HTAnchor*)parent != dest) && title ? "in " : "", - (char *)(title ? title : address)); + (title ? title : address)); FREE(address); #ifdef VMS if (HadVMSInterrupt) diff --git a/src/LYLocal.c b/src/LYLocal.c index a458ebe5..c7b914d5 100644 --- a/src/LYLocal.c +++ b/src/LYLocal.c @@ -378,7 +378,7 @@ PRIVATE BOOLEAN modify_tagged ARGS1( */ if (!strncmp(tmpbuf, "~/", 2)) { char *cp1 = NULL; - StrAllocCopy(cp1, (char *)Home_Dir()); + StrAllocCopy(cp1, Home_Dir()); StrAllocCat(cp1, (tmpbuf + 1)); if (strlen(cp1) > (sizeof(tmpbuf) - 1)) { sprintf(tmpbuf, "%s", "Path too long"); @@ -622,8 +622,7 @@ PRIVATE BOOLEAN modify_location ARGS1( * Allow ~/ references to the home directory. */ if (!strncmp(tmpbuf,"~/",2)) { - cp = (char *)Home_Dir(); - strcpy(newpath, cp); + strcpy(newpath, Home_Dir()); strcat(newpath, (tmpbuf + 1)); strcpy(tmpbuf, newpath); } @@ -2228,17 +2227,18 @@ PUBLIC int LYExecv ARGS3( while (wait(&wstatus) != pid) ; /* do nothing */ #else - while (-1 == waitpid (pid, &wstatus, 0)) /* wait for child */ - { + while (-1 == waitpid(pid, &wstatus, 0)) { /* wait for child */ #ifdef EINTR - if (errno == EINTR) continue; -#endif + if (errno == EINTR) + continue; +#endif /* EINTR */ #ifdef ERESTARTSYS - if (errno == ERESTARTSYS) continue; -#endif + if (errno == ERESTARTSYS) + continue; +#endif /* ERESTARTSYS */ break; } -#endif +#endif /* HAVE_TYPE_UNIONWAIT && !HAVE_WAITPID */ if (WEXITSTATUS(wstatus) != 0 || WTERMSIG(wstatus) > 0) { /* error return */ sprintf(tmpbuf, "Probable failure to %s due to system error!", diff --git a/src/LYMail.c b/src/LYMail.c index 028c43bb..59d8deb6 100644 --- a/src/LYMail.c +++ b/src/LYMail.c @@ -478,7 +478,7 @@ PUBLIC void mailmsg ARGS4(int,cur, char *,owner_address, PUBLIC void reply_by_mail ARGS3( char *, mail_address, char *, filename, - char *, title) + CONST char *, title) { char user_input[1000]; FILE *fd, *fp; diff --git a/src/LYMail.h b/src/LYMail.h index ce2d9aed..52e49ff6 100644 --- a/src/LYMail.h +++ b/src/LYMail.h @@ -19,8 +19,8 @@ extern void mailmsg PARAMS(( char * filename, char * linkname)); extern void reply_by_mail PARAMS(( - char * mail_address, - char * filename, - char * title)); + char * mail_address, + char * filename, + CONST char * title)); #endif /* LYMAIL_H */ diff --git a/src/LYMainLoop.c b/src/LYMainLoop.c index d2215e02..1e7dfdc5 100644 --- a/src/LYMainLoop.c +++ b/src/LYMainLoop.c @@ -173,8 +173,7 @@ int mainloop NOARGS int i; #ifdef DIRED_SUPPORT - char *tp; - char tmpbuf[1024]; + char *tp = NULL; struct stat dir_info; extern char LYPermitFileURL[]; extern char LYDiredFileURL[]; @@ -3650,21 +3649,25 @@ check_goto_URL: if (nlinks > 0) { cp = links[curdoc.link].lname; if (is_url(cp) == FILE_URL_TYPE) { - tp = cp; - if (!strncmp(tp, "file://localhost", 16)) - tp += 16; - else if (!strncmp(tp, "file:", 5)) - tp += 5; - strcpy(tmpbuf, tp); - HTUnEscape(tmpbuf); - if (stat(tmpbuf, &dir_info) == -1) { + if (!strncmp(tp, "file://localhost", 16)) { + /* + * This is the only case that should occur. - kw + */ + StrAllocCopy(tp, cp + 16); + } else if (!strncmp(tp, "file:", 5)) { + StrAllocCopy(tp, cp + 5); + } else { + StrAllocCopy(tp, cp); + } + HTUnEscape(tp); + if (stat(tp, &dir_info) == -1) { _statusline(NO_STATUS); sleep(AlertSecs); } else { if (((dir_info.st_mode) & S_IFMT) == S_IFREG) { - strcpy(tmpbuf, cp); - HTUnEscapeSome(tmpbuf, "/"); - if (edit_current_file(tmpbuf, + StrAllocCopy(tp, cp); + HTUnEscapeSome(tp, "/"); + if (edit_current_file(tp, curdoc.link, Newline)) { HTuncache_current_document(); StrAllocCopy(newdoc.address, @@ -3690,6 +3693,7 @@ check_goto_URL: } } } + FREE(tp); } } } else diff --git a/src/LYOptions.c b/src/LYOptions.c index f73e58ff..80c840fa 100644 --- a/src/LYOptions.c +++ b/src/LYOptions.c @@ -89,7 +89,7 @@ PRIVATE void option_user_message ARGS2( * Use _user_message() set to output on the bottom line. */ LYStatusLine = (LYlines - 1); - _user_message((char *)message, argument); + _user_message(message, argument); LYStatusLine = -1; } @@ -758,11 +758,11 @@ draw_options: if (!LYSelectPopups) { current_char_set = boolean_choice(current_char_set, L_CHARSET, -1, - LYchar_set_names); + (char **)LYchar_set_names); } else { current_char_set = popup_choice(current_char_set, L_CHARSET, -1, - LYchar_set_names, + (char **)LYchar_set_names, 0, FALSE); #if defined(VMS) || defined(USE_SLANG) move(L_CHARSET, COL_OPTION_VALUES); diff --git a/src/LYPrint.c b/src/LYPrint.c index d6f6e0a1..d6d444ce 100644 --- a/src/LYPrint.c +++ b/src/LYPrint.c @@ -80,12 +80,11 @@ PUBLIC int printfile ARGS1( HTFormat format; HTAtom *encoding; BOOL use_mime, use_cte, use_type; - char *disp_charset; + CONST char *disp_charset; static BOOLEAN first_mail_preparsed = TRUE; + char *envbuffer = NULL; #ifdef VMS extern BOOLEAN HadVMSInterrupt; -#else - char *envbuffer = NULL; /* WebSter Print Mods -jkt */ #endif /* VMS */ /* @@ -1030,26 +1029,40 @@ PUBLIC int printfile ARGS1( if (TRACE) fprintf(stderr, "command: %s\n", buffer); printf(PRINTING_FILE); - -#ifndef VMS - /* Begin WebSter Print Mods - jkt */ +#ifdef VMS + /* + * Set document's title as a VMS logical. - FM + */ + StrAllocCopy(envbuffer, HText_getTitle()); + if (!(envbuffer && *envbuffer)) + StrAllocCopy(envbuffer, "No Title"); + Define_VMSLogical("LYNX_PRINT_TITLE", envbuffer); +#else + /* + * Set document's title as an environment variable. - JKT + */ StrAllocCopy(envbuffer, "LYNX_PRINT_TITLE="); StrAllocCat(envbuffer, HText_getTitle()); putenv(envbuffer); - /* End WebSter Print Mods - jkt */ -#endif /* !VMS */ - +#endif /* VMS */ fflush(stdout); system(buffer); - fflush(stdout); -#ifndef VMS - signal(SIGINT, cleanup_sig); +#ifdef VMS /* - * Remove LYNX_PRINT_TITLE value from environment - kw + * Remove LYNX_PRINT_TITLE logical. - FM + */ + Define_VMSLogical("LYNX_PRINT_TITLE", ""); +#else + /* + * Remove LYNX_PRINT_TITLE value from environment. - KW */ envbuffer[17] = '\0'; /* truncate after '=' */ putenv(envbuffer); +#endif /* VMS */ FREE(envbuffer); + fflush(stdout); +#ifndef VMS + signal(SIGINT, cleanup_sig); #endif /* !VMS */ sleep(MessageSecs); start_curses(); diff --git a/src/LYStrings.c b/src/LYStrings.c index aac67203..dd07fe98 100644 --- a/src/LYStrings.c +++ b/src/LYStrings.c @@ -98,7 +98,7 @@ PRIVATE int set_clicked_link ARGS2(int,x,int,y) */ PUBLIC char *LYstrncpy ARGS3( char *, dst, - char *, src, + CONST char *, src, int, n) { char *val; @@ -125,7 +125,7 @@ PUBLIC char *LYstrncpy ARGS3( * src string is copied until either end of string or max number of * either bytes or glyphs (mbcs sequences) (currently only UTF8). */ -PUBLIC char * LYmbcsstrncpy ARGS5(char *,dst, char *,src, int,n_bytes, +PUBLIC char * LYmbcsstrncpy ARGS5(char *,dst, CONST char *,src, int,n_bytes, int,n_glyphs, int,utf_flag) { char *val = dst; diff --git a/src/LYStrings.h b/src/LYStrings.h index 7124a0b9..6432f475 100644 --- a/src/LYStrings.h +++ b/src/LYStrings.h @@ -7,7 +7,7 @@ extern char *strstr(); #endif /* __STRICT_BSD__ */ extern int get_mouse_link NOPARAMS; -extern char * LYstrncpy PARAMS((char *dst, char *src, int n)); +extern char * LYstrncpy PARAMS((char *dst, CONST char *src, int n)); extern int LYgetch NOPARAMS; extern int LYgetstr PARAMS((char *inputline, int hidden, int bufsize, int recall)); @@ -33,7 +33,7 @@ extern int LYmbcsstrlen PARAMS(( BOOL utf_flag)); extern char * LYmbcsstrncpy PARAMS(( char * dst, - char * src, + CONST char * src, int n_bytes, int n_glyphs, int enc)); @@ -65,7 +65,7 @@ extern char * SNACat PARAMS((char **dest, CONST char *src, int n)); #define SELECT_KEY 267 /* 0x10B */ #define INSERT_KEY 268 /* 0x10C */ #define REMOVE_KEY 269 /* 0x10D */ -#define DO_NOTHING 270 /* 0x00E */ +#define DO_NOTHING 270 /* 0x10E */ #define VISIBLE 0 #define HIDDEN 1 diff --git a/src/LYStyle.c b/src/LYStyle.c index 0d9d0724..8e36c09d 100644 --- a/src/LYStyle.c +++ b/src/LYStyle.c @@ -1,6 +1,6 @@ /* character level styles for Lynx * (c) 1996 Rob Partington -- donated to the Lyncei (if they want it :-) - * $Id: LYStyle.c,v 1.2 1997/09/17 23:34:13 tom Exp $ + * $Id: LYStyle.c,v 1.3 1997/09/19 01:14:00 klaus Exp $ */ #include "HTUtils.h" #include "HTML.h" @@ -123,7 +123,7 @@ PRIVATE void parse_attributes ARGS5(char*,mono,char*,fg,char*,bg,int,style,char* * If we have colour, and space to create a new colour attribute, * and we have a valid colour description, then add this style */ - if (lynx_uses_color && colorPairs < COLOR_PAIRS-1 && fA!=-1) + if (lynx_has_color && colorPairs < COLOR_PAIRS-1 && fA!=-1) { colorPairs++; init_pair(colorPairs, fA, bA); diff --git a/src/LYStyle.h b/src/LYStyle.h index 02eab3d9..8ec3c52c 100644 --- a/src/LYStyle.h +++ b/src/LYStyle.h @@ -12,7 +12,7 @@ extern CONST SGML_dtd HTML_dtd; extern HTCharStyle displayStyles[DSTYLE_ELEMENTS]; /* Can we do colour? - RP */ -extern int lynx_uses_color; +extern int lynx_has_color; /* Set all the buckets in the hash table to be empty */ extern void style_initialiseHashTable NOPARAMS; diff --git a/src/LYUtils.c b/src/LYUtils.c index a4b5225a..c2d6a13a 100644 --- a/src/LYUtils.c +++ b/src/LYUtils.c @@ -1892,7 +1892,7 @@ PUBLIC void statusline ARGS1( int a=(strncmp(buffer, "Alert", 5) || !hashStyles[s_alert].name ? s_status : s_alert); LynxChangeStyle (a, ABS_ON, 1); addstr(buffer); - wbkgdset(stdscr, (lynx_uses_color + wbkgdset(stdscr, (lynx_has_color ? hashStyles[a].color : hashStyles[a].mono) | ' '); clrtoeol(); @@ -4654,7 +4654,7 @@ PUBLIC void LYDoCSI ARGS3( CONST char *, comment, char **, csi) { - char *cp = (char *)comment; + CONST char *cp = comment; if (cp == NULL) return; diff --git a/src/UCAux.c b/src/UCAux.c index 401280a5..bb95e915 100644 --- a/src/UCAux.c +++ b/src/UCAux.c @@ -44,8 +44,8 @@ PUBLIC BOOL UCCanTranslateFromTo ARGS2( return (LYCharSet_UC[from].UChndl >= 0); } { - char * fromname = LYCharSet_UC[from].MIMEname; - char * toname = LYCharSet_UC[to].MIMEname; + CONST char * fromname = LYCharSet_UC[from].MIMEname; + CONST char * toname = LYCharSet_UC[to].MIMEname; if (!strcmp(fromname, "x-transparent") || !strcmp(toname, "x-transparent")) { return YES; diff --git a/src/UCdomap.c b/src/UCdomap.c index 68b82403..548096d5 100644 --- a/src/UCdomap.c +++ b/src/UCdomap.c @@ -52,8 +52,8 @@ #include "[.chrtrans]cp1250_uni.h" #include "[.chrtrans]cp1251_uni.h" #include "[.chrtrans]cp1252_uni.h" -#include "[.chrtrans]utf8_uni.h" #include "[.chrtrans]viscii_uni.h" +#include "[.chrtrans]utf8_uni.h" #include "[.chrtrans]rfc_suni.h" #include "[.chrtrans]mnemonic_suni.h" #ifdef NOTDEFINED @@ -314,7 +314,7 @@ PRIVATE int UC_MapGN PARAMS(( int UChndl, int update_flag)); PRIVATE int UC_FindGN_byMIME PARAMS(( - char * UC_MIMEcharset)); + CONST char * UC_MIMEcharset)); PRIVATE void UCreset_allocated_LYCharSets NOPARAMS; PRIVATE void UCfree_allocated_LYCharSets NOPARAMS; PRIVATE char ** UC_setup_LYCharSets_repl PARAMS(( @@ -322,8 +322,8 @@ PRIVATE char ** UC_setup_LYCharSets_repl PARAMS(( int lowest8)); PRIVATE int UC_Register_with_LYCharSets PARAMS(( int s, - char * UC_MIMEcharset, - char * UC_LYNXcharset, + CONST char * UC_MIMEcharset, + CONST char * UC_LYNXcharset, int lowest_eightbit)); PRIVATE void UCcleanup_mem NOPARAMS; @@ -1064,21 +1064,23 @@ PUBLIC long int UCTransToUni ARGS2( ch_iu = (unsigned char)ch_in; #ifndef UC_NO_SHORTCUTS - if (charset_in == 0) - return ch_iu; - if ((unsigned char)ch_in < 128 && (unsigned char)ch_in >= 32) - return ch_iu; + if (charset_in == 0) + return ch_iu; + if ((unsigned char)ch_in < 128 && (unsigned char)ch_in >= 32) + return ch_iu; #endif /* UC_NO_SHORTCUTS */ if (charset_in < 0) return -11; - if ((unsigned char)ch_in < 32 && - LYCharSet_UC[charset_in].enc != UCT_ENC_8BIT_C0) - /* don't translate C0 chars except for specific charsets */ - return ch_iu; - if ((UChndl_in = LYCharSet_UC[charset_in].UChndl) < 0) - return -11; - if (!UCInfo[UChndl_in].num_uni) - return -11; + if ((unsigned char)ch_in < 32 && + LYCharSet_UC[charset_in].enc != UCT_ENC_8BIT_C0) + /* + * Don't translate C0 chars except for specific charsets. + */ + return ch_iu; + if ((UChndl_in = LYCharSet_UC[charset_in].UChndl) < 0) + return -11; + if (!UCInfo[UChndl_in].num_uni) + return -11; if ((Gn = UCInfo[UChndl_in].GN) < 0) { Gn = UC_MapGN(UChndl_in,1); } @@ -1219,7 +1221,7 @@ if (buflen<2) } PRIVATE int UC_FindGN_byMIME ARGS1( - char *, UC_MIMEcharset) + CONST char *, UC_MIMEcharset) { int i; @@ -1500,8 +1502,8 @@ PRIVATE char ** UC_setup_LYCharSets_repl ARGS2( */ PRIVATE int UC_Register_with_LYCharSets ARGS4( int, s, - char *, UC_MIMEcharset, - char *, UC_LYNXcharset, + CONST char *, UC_MIMEcharset, + CONST char *, UC_LYNXcharset, int, lowest_eightbit) { int i, LYhndl,found; @@ -1555,7 +1557,7 @@ PRIVATE int UC_Register_with_LYCharSets ARGS4( * Hmm, try to be conservative here. */ LYchar_set_names[LYhndl] = UC_LYNXcharset; - LYchar_set_names[LYhndl+1] = (char *) 0; + LYchar_set_names[LYhndl+1] = NULL; /* * Terminating NULL may be looked for by Lynx code. */ @@ -1596,8 +1598,8 @@ PRIVATE int UC_Register_with_LYCharSets ARGS4( * is done here yet. */ PUBLIC void UC_Charset_Setup ARGS8( - char *, UC_MIMEcharset, - char *, UC_LYNXcharset, + CONST char *, UC_MIMEcharset, + CONST char *, UC_LYNXcharset, u8 *, unicount, u16 *, unitable, int, nnuni, diff --git a/src/UCdomap.h b/src/UCdomap.h index 7ddd835a..8c941464 100644 --- a/src/UCdomap.h +++ b/src/UCdomap.h @@ -23,8 +23,8 @@ UC[A-Z]* to be exported to other parts of Lynx. -kw */ extern void UC_Charset_Setup PARAMS(( - char * UC_MIMEcharset, - char * UC_LYNXcharset, + CONST char * UC_MIMEcharset, + CONST char * UC_LYNXcharset, u8 * unicount, u16 * unitable, int nnuni, @@ -37,8 +37,8 @@ char *UC_GNsetMIMEnames[4] = int UC_GNhandles[4] = {-1, -1, -1, -1}; struct UC_charset { - char *MIMEname; - char *LYNXname; + CONST char *MIMEname; + CONST char *LYNXname; u8* unicount; u16* unitable; int num_uni; diff --git a/src/chrtrans/def7_uni.tbl b/src/chrtrans/def7_uni.tbl index bba7cc12..a2b5a4b2 100644 --- a/src/chrtrans/def7_uni.tbl +++ b/src/chrtrans/def7_uni.tbl @@ -3,7 +3,7 @@ # character set. #The MIME name of this charset. -M us-ascii +Mus-ascii # Shall this become the "default" translation table? YES! # There has to be exactly one table marked as "default". @@ -498,7 +498,7 @@ U+0481:c3 U+0490:G3 U+0491:g3 -# These may may Yiddish slightly more readable, until we have +# These may make Yiddish slightly more readable, until we have # something better. 0x69 U+05b4 # i @@ -939,7 +939,7 @@ U+1358:mYa U+1359:rYa U+135A:fYa # ETHIOPIC SPACE U+1360 mapped to ASCII space -0x20 U+1360 +0x20 U+1360 0x3a U+1361 #:: U+1362::: 0x2c U+1363 #:, |