about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>1998-03-06 19:00:00 -0500
committerThomas E. Dickey <dickey@invisible-island.net>1998-03-06 19:00:00 -0500
commit373bfbe1a5d037b9eb53f512a3332746e10607a2 (patch)
tree6017109a8287677f6073c384ade5783cdcec5266 /src
parente9b52cbfe84bc9e13568e784836c9e0b4b1e0913 (diff)
downloadlynx-snapshots-373bfbe1a5d037b9eb53f512a3332746e10607a2.tar.gz
snapshot of project "lynx", label v2-8pre_4
Diffstat (limited to 'src')
-rw-r--r--src/HTML.h41
-rw-r--r--src/LYCharUtils.c6
-rw-r--r--src/LYCurses.c28
-rw-r--r--src/LYStrings.c6
-rw-r--r--src/LYUtils.c7
5 files changed, 48 insertions, 40 deletions
diff --git a/src/HTML.h b/src/HTML.h
index 7cb4adfe..d75a10bd 100644
--- a/src/HTML.h
+++ b/src/HTML.h
@@ -51,7 +51,7 @@ extern CONST HTStructuredClass HTMLPresentation;
 */
 
 typedef struct _stack_element {
-        HTStyle *	style;
+	HTStyle *	style;
 	int		tag_number;
 } stack_element;
 
@@ -234,38 +234,29 @@ extern void strtolower PARAMS((char* i));
 **  HTConverter to present HTML
 */
 extern HTStream* HTMLToPlain PARAMS((
-        HTPresentation *        pres,
-        HTParentAnchor *        anchor,
-        HTStream *              sink));
+	HTPresentation *	pres,
+	HTParentAnchor *	anchor,
+	HTStream *		sink));
 
 extern HTStream* HTMLParsedPresent PARAMS((
-        HTPresentation *        pres,
-        HTParentAnchor *        anchor,
-        HTStream *              sink));
+	HTPresentation *	pres,
+	HTParentAnchor *	anchor,
+	HTStream *		sink));
 
 extern HTStream* HTMLToC PARAMS((
-        HTPresentation *        pres,
-        HTParentAnchor *        anchor,
-        HTStream *              sink));
+	HTPresentation *	pres,
+	HTParentAnchor *	anchor,
+	HTStream *		sink));
 
 extern HTStream* HTMLPresent PARAMS((
-        HTPresentation *        pres,
-        HTParentAnchor *        anchor,
-        HTStream *              sink));
+	HTPresentation *	pres,
+	HTParentAnchor *	anchor,
+	HTStream *		sink));
 
 extern HTStructured* HTML_new PARAMS((
-        HTParentAnchor * anchor,
-        HTFormat        format_out,
-        HTStream *      target));
-
-/*
-**  Names for selected internal representations.
-*/
-typedef enum _HTMLCharacterSet {
-        HTML_ISO_LATIN1,
-        HTML_NEXT_CHARS,
-        HTML_PC_CP950
-} HTMLCharacterSet;
+	HTParentAnchor * anchor,
+	HTFormat	format_out,
+	HTStream *	target));
 
 /*
 **  Record error message as a hypertext object.
diff --git a/src/LYCharUtils.c b/src/LYCharUtils.c
index 7055814f..1f0d325d 100644
--- a/src/LYCharUtils.c
+++ b/src/LYCharUtils.c
@@ -414,9 +414,9 @@ PUBLIC void LYFillLocalFileURL ARGS2(
 **  disp_chndl) already corresponds to the charset assumption that
 **  would be made when the file is read. - KW
 **
-**  Currently this function used for temporary files like "Lynx Info Page"
-**  and for one permanent - bookmarks (so may be a problem if you change
-**  display charset later: new bookmark entries may be wrongly interpreted).
+**  Currently this function is used for temporary files like "Lynx Info Page"
+**  and for one permanent - bookmarks (so it may be a problem if you change
+**  the display charset later: new bookmark entries may be mistranslated).
 ** 								 - LP
 */
 PUBLIC void LYAddMETAcharsetToFD ARGS2(
diff --git a/src/LYCurses.c b/src/LYCurses.c
index 70eeb249..9defcfa2 100644
--- a/src/LYCurses.c
+++ b/src/LYCurses.c
@@ -42,6 +42,8 @@ extern int _NOSHARE(COLS);
 int lynx_has_color = FALSE;
 #endif
 
+#define COLOR_BKGD ((COLOR_PAIRS >= 9) ? COLOR_PAIR(9) : A_NORMAL)
+
 /*
  *  These are routines to start and stop curses and to cleanup
  *  the screen at the end.
@@ -511,7 +513,9 @@ PRIVATE void LYsetWAttr ARGS1(WINDOW *, win)
 		attr |= A_UNDERLINE;
 	}
 
-	attr |= COLOR_PAIR(code+offs);
+	if (code+offs < COLOR_PAIRS) {
+		attr |= COLOR_PAIR(code+offs);
+	}
 
 	wattrset(win, attr);
     } else {
@@ -534,12 +538,14 @@ PRIVATE void lynx_map_color ARGS1(int, n)
 
     if (lynx_called_initscr) {
 	for (m = 0; m <= 16; m += 8) {
-	    init_pair(n+m+1,
-		lynx_color_pairs[n+m+1].fg,
-		lynx_color_pairs[n+m+1].bg);
+	    int pair = n + m + 1;
+	    if (pair < COLOR_PAIRS)
+		init_pair(pair,
+		    lynx_color_pairs[pair].fg,
+		    lynx_color_pairs[pair].bg);
 	}
 	if (n == 0 && LYShowColor >= SHOW_COLOR_ON)
-	    bkgd(COLOR_PAIR(9) | ' ');
+	    bkgd(COLOR_BKGD | ' ');
     }
 }
 
@@ -563,7 +569,10 @@ PUBLIC int lynx_chg_color ARGS3(
 PUBLIC void lynx_set_color ARGS1(int, a)
 {
     if (lynx_has_color && LYShowColor >= SHOW_COLOR_ON) {
-	attrset(lynx_color_cfg[a].attr | COLOR_PAIR(a+1));
+	attrset(lynx_color_cfg[a].attr
+		| (((a+1) < COLOR_PAIRS)
+			? COLOR_PAIR(a+1)
+			: A_NORMAL));
     }
 }
 
@@ -586,12 +595,13 @@ PRIVATE void lynx_init_colors NOARGS
 	for (n = 0; n < sizeof(lynx_color_cfg)/sizeof(lynx_color_cfg[0]); n++) {
 	    for (m = 0; m <= 16; m += 8) {
 		int pair = n + m + 1;
-		init_pair(pair,
+		if (pair < COLOR_PAIRS)
+		    init_pair(pair,
 			lynx_color_pairs[pair].fg,
 			lynx_color_pairs[pair].bg);
 	    }
 	    if (n == 0 && LYShowColor >= SHOW_COLOR_ON)
-		bkgd(COLOR_PAIR(9) | ' ');
+		bkgd(COLOR_BKGD | ' ');
 	}
     } else if (LYShowColor != SHOW_COLOR_NEVER) {
 	LYShowColor = SHOW_COLOR_OFF;
@@ -1660,7 +1670,7 @@ PUBLIC void lynx_force_repaint NOARGS
     chtype a;
 #ifndef USE_COLOR_STYLE
     if (LYShowColor >= SHOW_COLOR_ON)
-	a = COLOR_PAIR(9);
+	a = COLOR_BKGD;
     else
 #endif
 	a = A_NORMAL;
diff --git a/src/LYStrings.c b/src/LYStrings.c
index 64f74c05..52aac4b0 100644
--- a/src/LYStrings.c
+++ b/src/LYStrings.c
@@ -1632,10 +1632,10 @@ PUBLIC char * SNACat ARGS3(
 */
 PUBLIC int UPPER8(int ch1, int ch2)
 {
-    /* Use exact match for speed, but mostly for stability	    */
+    /* Try case-Sensitive match for speed, but mostly for stability */
     /* while doing experiments with the remainder of this function. */
-    if (ch1==ch2)
-	return(0);  /* Exact match */
+    if ((unsigned char)ch1==(unsigned char)ch2)
+       return(0);
 
     /* case-insensitive match for us-ascii */
     if ((unsigned char)ch1 < 128 && (unsigned char)ch2 < 128)
diff --git a/src/LYUtils.c b/src/LYUtils.c
index 17d959b9..b778ed71 100644
--- a/src/LYUtils.c
+++ b/src/LYUtils.c
@@ -4122,7 +4122,14 @@ have_VMS_URL:
 		/*
 		 *  It is a subdirectory or file on the local system.
 		 */
+#ifndef DOSPATH
 		cp = HTEscape(temp, URL_PATH);
+#else
+		/* We need not escape DOS local paths such as c:    */
+		/* especially when we really have file://localhost/ */
+		/* at the beginning.				    */
+		StrAllocCopy(cp, temp);
+#endif /* DOSPATH */
 		StrAllocCat(*AllocatedString, cp);
 		FREE(cp);
 		if (TRACE) {