about summary refs log tree commit diff stats
path: root/WWW/Library
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2001-06-03 21:17:35 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2001-06-03 21:17:35 -0400
commitd1349dd61e0c9248ec9be3edaa37a67952e44300 (patch)
treecc38442efa38ebd0cbb683866bc0ac8caf066a69 /WWW/Library
parent8c68f693cc82e6650afff52fe478c0ccde4bc015 (diff)
downloadlynx-snapshots-d1349dd61e0c9248ec9be3edaa37a67952e44300.tar.gz
snapshot of project "lynx", label v2-8-4dev_21
Diffstat (limited to 'WWW/Library')
-rw-r--r--WWW/Library/Implementation/HTAAProt.c4
-rw-r--r--WWW/Library/Implementation/HTAnchor.c4
-rw-r--r--WWW/Library/Implementation/HTCJK.h6
-rw-r--r--WWW/Library/Implementation/HTFTP.c34
-rw-r--r--WWW/Library/Implementation/HTFile.c4
-rw-r--r--WWW/Library/Implementation/HTFormat.c58
-rw-r--r--WWW/Library/Implementation/HTFormat.h7
-rw-r--r--WWW/Library/Implementation/HTMLDTD.c6
-rw-r--r--WWW/Library/Implementation/HTMLDTD.h3
-rw-r--r--WWW/Library/Implementation/HTNews.c2
-rw-r--r--WWW/Library/Implementation/HTString.c9
-rw-r--r--WWW/Library/Implementation/HTTCP.c6
-rw-r--r--WWW/Library/Implementation/HTTP.c51
-rw-r--r--WWW/Library/Implementation/HTUtils.h16
-rw-r--r--WWW/Library/Implementation/HTVMSUtils.c25
-rw-r--r--WWW/Library/Implementation/HTWAIS.c8
-rw-r--r--WWW/Library/Implementation/HTWSRC.c2
-rw-r--r--WWW/Library/Implementation/HText.h2
-rw-r--r--WWW/Library/Implementation/SGML.c180
-rw-r--r--WWW/Library/Implementation/www_tcp.h8
-rw-r--r--WWW/Library/djgpp/CommonMakefile5
-rw-r--r--WWW/Library/djgpp/makefile36
22 files changed, 168 insertions, 308 deletions
diff --git a/WWW/Library/Implementation/HTAAProt.c b/WWW/Library/Implementation/HTAAProt.c
index 1e83df8f..6821068f 100644
--- a/WWW/Library/Implementation/HTAAProt.c
+++ b/WWW/Library/Implementation/HTAAProt.c
@@ -575,13 +575,16 @@ typedef struct {
 	int user;
 	} USER_DATA;
 
+#ifndef NOUSERS
 PRIVATE HTList *known_grp = NULL;
 PRIVATE HTList *known_pwd = NULL;
 PRIVATE BOOL uidgid_cache_inited = NO;
+#endif
 
 #ifdef LY_FIND_LEAKS
 PRIVATE void clear_uidgid_cache NOARGS
 {
+#ifndef NOUSERS
     USER_DATA *data;
     if (known_grp) {
 	while ((data = HTList_removeLastObject(known_grp)) != NULL) {
@@ -597,6 +600,7 @@ PRIVATE void clear_uidgid_cache NOARGS
 	}
 	FREE(known_pwd);
     }
+#endif
 }
 #endif /* LY_FIND_LEAKS */
 
diff --git a/WWW/Library/Implementation/HTAnchor.c b/WWW/Library/Implementation/HTAnchor.c
index 8656c4ac..631c665f 100644
--- a/WWW/Library/Implementation/HTAnchor.c
+++ b/WWW/Library/Implementation/HTAnchor.c
@@ -779,7 +779,7 @@ PUBLIC BOOL HTAnchor_delete ARGS1(
      *	Remove ourselves from the hash table's list.
      */
     if (adult_table) {
-	unsigned short int usi_hash = HASH_FUNCTION(me->address);
+	unsigned short usi_hash = (unsigned short) HASH_FUNCTION(me->address);
 
 	if (adult_table[usi_hash])  {
 	    HTList_removeObject(adult_table[usi_hash], (void *)me);
@@ -1399,7 +1399,7 @@ PUBLIC int HTAnchor_getUCLYhndl ARGS2(
 #ifdef CAN_SWITCH_DISPLAY_CHARSET
 PRIVATE void setup_switch_display_charset ARGS2(HTParentAnchor *, me, int, h)
 {
-    if (!Switch_Display_Charset(h,0))
+    if (!Switch_Display_Charset(h,SWITCH_DISPLAY_CHARSET_MAYBE))
 	return;
     HTAnchor_setUCInfoStage(me, current_char_set,
 			    UCT_STAGE_HTEXT, UCT_SETBY_MIME); /* highest priorty! */
diff --git a/WWW/Library/Implementation/HTCJK.h b/WWW/Library/Implementation/HTCJK.h
index 611aac98..83d5528d 100644
--- a/WWW/Library/Implementation/HTCJK.h
+++ b/WWW/Library/Implementation/HTCJK.h
@@ -40,12 +40,6 @@
 #define IS_SJIS_2BYTE(hi,lo) (IS_SJIS_LO(lo)&&(IS_SJIS_HI1(hi)||IS_SJIS_HI2(hi)))
 #define IS_SJIS_X0201KANA(lo) ((0xA1<=lo)&&(lo<=0xDF))
 
-#if 0 /* IS_EUC_LOS isn't used because we are interested only in EUC-JP's
-       * code set 0 to 2 now. -- TH
-       * ref: http://www.isi.edu/in-notes/iana/assignments/character-sets
-       */
-#define IS_EUC_LOS(lo)	((0x21<=lo)&&(lo<=0x7E))	/* standard */
-#endif
 #define IS_EUC_LOX(lo)	((0xA1<=lo)&&(lo<=0xFE))	/* extended */
 #define IS_EUC_HI(hi)	((0xA1<=hi)&&(hi<=0xFE))
 #define IS_EUC_X0201KANA(hi,lo) ((hi==0x8E)&&(0xA1<=lo)&&(lo<=0xDF))
diff --git a/WWW/Library/Implementation/HTFTP.c b/WWW/Library/Implementation/HTFTP.c
index a580925f..8cd3099c 100644
--- a/WWW/Library/Implementation/HTFTP.c
+++ b/WWW/Library/Implementation/HTFTP.c
@@ -101,10 +101,6 @@ typedef struct _connection {
     BOOL			binary; /* Binary mode? */
 } connection;
 
-#ifndef NIL
-#define NIL 0
-#endif /* !NIL */
-
 /*		Hypertext object building machinery
 */
 #include <HTML.h>
@@ -171,14 +167,14 @@ PRIVATE BOOLEAN use_list = FALSE;		/* use the LIST command? */
 PRIVATE int	interrupted_in_next_data_char = FALSE;
 
 #ifdef POLL_PORTS
-PRIVATE unsigned short	port_number = FIRST_TCP_PORT;
+PRIVATE PortNumber	port_number = FIRST_TCP_PORT;
 #endif /* POLL_PORTS */
 
 PRIVATE int	master_socket = -1;	/* Listening socket = invalid	*/
 PRIVATE char	port_command[255];	/* Command for setting the port */
 PRIVATE fd_set	open_sockets;		/* Mask of active channels */
 PRIVATE int	num_sockets;		/* Number of sockets to scan */
-PRIVATE unsigned short	passive_port;	/* Port server specified for data */
+PRIVATE PortNumber	passive_port;	/* Port server specified for data */
 
 
 #define NEXT_CHAR HTGetCharacter()	/* Use function in HTFormat.c */
@@ -380,7 +376,7 @@ PRIVATE char *help_message_cache_contents NOARGS
 **
 ** On entry,
 **	control	points to the connection which is established.
-**	cmd	points to a command, or is NIL to just get the response.
+**	cmd	points to a command, or is zero to just get the response.
 **
 **	The command should already be terminated with the CRLF pair.
 **
@@ -433,7 +429,7 @@ PRIVATE int write_cmd ARGS1(
 **
 ** On entry,
 **	control	points to the connection which is established.
-**	cmd	points to a command, or is NIL to just get the response.
+**	cmd	points to a command, or is zero to just get the response.
 **
 **	The command must already be terminated with the CRLF pair.
 **
@@ -523,16 +519,6 @@ PRIVATE int response ARGS1(
     return result/100;
 }
 
-#if 0
-PRIVATE int send_cmd_nowait ARGS1(char *, verb)
-{
-    char command[20];
-
-    sprintf(command, "%.*s%c%c", (int) sizeof(command)-4, verb, CR, LF);
-    return write_cmd(command);
-}
-#endif
-
 PRIVATE int send_cmd_1 ARGS1(char *, verb)
 {
     char command[80];
@@ -1156,7 +1142,7 @@ PRIVATE int get_listen_socket NOARGS
 #endif /* INET6 */
 #ifdef POLL_PORTS
     {
-	unsigned short old_port_number = port_number;
+	PortNumber old_port_number = port_number;
 	for (port_number = (old_port_number+1); ; port_number++) {
 	    int status;
 	    if (port_number > LAST_TCP_PORT)
@@ -2908,7 +2894,7 @@ unload_btree:
     if (WasInterrupted || data_soc != -1) { /* should always be true */
 	/*
 	 *  Without closing the data socket first,
-	 *  the response(NIL) later may hang.
+	 *  the response(0) later may hang.
 	 *  Some servers expect the client to fin/ack the close
 	 *  of the data connection before proceeding with the
 	 *  conversation on the control connection. - kw
@@ -3084,7 +3070,7 @@ PUBLIC int HTFTPLoad ARGS4(
 		fprintf(tfp, "HTFTP: PASV reply has no inet address!\n");
 		return -99;
 	    }
-	    passive_port = (p0<<8) + p1;
+	    passive_port = (PortNumber)((p0<<8) + p1);
 #endif /* INET6 */
 	    CTRACE((tfp, "HTFTP: Server is listening on port %d\n",
 			 passive_port));
@@ -3635,7 +3621,7 @@ listen:
 	if (final_status > 0) {
 	    if (server_type != CMS_SERVER)
 		if (outstanding-- > 0) {
-		    status = response(NIL);
+		    status = response(0);
 		    if (status < 0 ||
 			(status == 2 && !strncmp(response_text, "221", 3)))
 			outstanding = 0;
@@ -3731,7 +3717,7 @@ listen:
 	    (void) HTInetStatus("close");	/* Comment only */
 	} else {
 	    if (rv != HT_LOADED && outstanding--) {
-		status = response(NIL);		/* Pick up final reply */
+		status = response(0);		/* Pick up final reply */
 		if (status != 2 && rv != HT_INTERRUPTED && rv != -1) {
 		    data_soc = -1;		/* invalidate it */
 		    init_help_message_cache();  /* to free memory */
@@ -3746,7 +3732,7 @@ listen:
     }
     while (outstanding-- > 0 &&
 	   (status > 0)) {
-	status = response(NIL);
+	status = response(0);
 	if (status == 2 && !strncmp(response_text, "221", 3))
 	    break;
     }
diff --git a/WWW/Library/Implementation/HTFile.c b/WWW/Library/Implementation/HTFile.c
index 342a5882..b302120c 100644
--- a/WWW/Library/Implementation/HTFile.c
+++ b/WWW/Library/Implementation/HTFile.c
@@ -1886,7 +1886,7 @@ PRIVATE int print_local_dir ARGS5(
 			    }
 #endif /* !LONG_LIST */
 			state =
-			   (*(char *)(HTBTree_object(next_element))
+			   (char) (*(char *)(HTBTree_object(next_element))
 			    == 'D' ? 'D' : 'F');
 			START(HTML_H2);
 			if (dir_list_style != MIXED_STYLE) {
@@ -1913,7 +1913,7 @@ PRIVATE int print_local_dir ARGS5(
 			}
 #endif /* !LONG_LIST */
 			state =
-			  (*(char *)(HTBTree_object(next_element))
+			  (char) (*(char *)(HTBTree_object(next_element))
 			   == 'D' ? 'D' : 'F');
 			START(HTML_H2);
 			START(HTML_EM);
diff --git a/WWW/Library/Implementation/HTFormat.c b/WWW/Library/Implementation/HTFormat.c
index 1148e308..70184064 100644
--- a/WWW/Library/Implementation/HTFormat.c
+++ b/WWW/Library/Implementation/HTFormat.c
@@ -95,7 +95,7 @@ PUBLIC void HTSetPresentation ARGS6(
 	double,		secs_per_byte,
 	long int,	maxbytes)
 {
-    HTPresentation * pres = (HTPresentation *)malloc(sizeof(HTPresentation));
+    HTPresentation * pres = typecalloc(HTPresentation);
     if (pres == NULL)
 	outofmem(__FILE__, "HTSetPresentation");
 
@@ -140,7 +140,7 @@ PUBLIC void HTSetConversion ARGS7(
 	float,		secs_per_byte,
 	long int,	maxbytes)
 {
-    HTPresentation * pres = (HTPresentation *)malloc(sizeof(HTPresentation));
+    HTPresentation * pres = typecalloc(HTPresentation);
     if (pres == NULL)
 	outofmem(__FILE__, "HTSetConversion");
 
@@ -297,7 +297,7 @@ PUBLIC char HTGetSSLCharacter ARGS1(void *, handle)
  */
 PRIVATE int half_match ARGS2(char *,trial_type, char *,target)
 {
-    char *cp=strchr(trial_type,'/');
+    char *cp = strchr(trial_type, '/');
 
     /* if no '/' or no '*' */
     if (!cp || *(cp+1) != '*')
@@ -490,6 +490,56 @@ PUBLIC void HTReorderPresentation ARGS2(
 	HTList_addObject(HTPresentations, match);
     }
 }
+
+/*
+ * Setup 'get_accept' flag to denote presentations that are not redundant,
+ * and will be listed in "Accept:" header.
+ */
+PUBLIC void HTFilterPresentations NOARGS
+{
+    int i, j;
+    int n = HTList_count(HTPresentations);
+    HTPresentation *p, *q;
+    BOOL matched;
+    char *s, *t, *x, *y;
+
+    for (i = 0; i < n; i++) {
+	p = (HTPresentation *)HTList_objectAt(HTPresentations, i);
+	s = HTAtom_name(p->rep);
+
+	if (p->rep_out == WWW_PRESENT) {
+	    if (p->rep != WWW_SOURCE
+	     && strcasecomp(s, "www/mime")
+	     && strcasecomp(s, "www/compressed")
+	     && p->quality <= 1.0 && p->quality >= 0.0) {
+		for (j = 0, matched = FALSE; j < i; j++) {
+		    q = (HTPresentation *)HTList_objectAt(HTPresentations, j);
+		    t = HTAtom_name(q->rep);
+
+		    if (!strcasecomp(s, t)) {
+			matched = TRUE;
+			break;
+		    }
+		    if ((x = strchr(s, '/')) != 0
+		     && (y = strchr(t, '/')) != 0) {
+			int len1 = x++ - s;
+			int len2 = y++ - t;
+			int lens = (len1 > len2) ? len1 : len2;
+
+			if ((*t == '*' || !strncasecomp(s, t, lens))
+			 && (*y == '*' || !strcasecomp(x, y))) {
+			    matched = TRUE;
+			    break;
+			}
+		    }
+		}
+		if (!matched)
+		    p->get_accept = TRUE;
+	    }
+	}
+    }
+}
+
 /*		Find the cost of a filter stack
 **		-------------------------------
 **
@@ -1403,7 +1453,7 @@ PRIVATE HTStreamClass NetToTextClass = {
 */
 PUBLIC HTStream * HTNetToText ARGS1(HTStream *, sink)
 {
-    HTStream* me = (HTStream*)malloc(sizeof(*me));
+    HTStream* me = typecalloc(HTStream);
 
     if (me == NULL)
 	outofmem(__FILE__, "NetToText");
diff --git a/WWW/Library/Implementation/HTFormat.h b/WWW/Library/Implementation/HTFormat.h
index 8cba2c05..63c96f5b 100644
--- a/WWW/Library/Implementation/HTFormat.h
+++ b/WWW/Library/Implementation/HTFormat.h
@@ -172,6 +172,7 @@ struct _HTPresentation {
         float		secs;
         float		secs_per_byte;
 	long int	maxbytes;
+	BOOL		get_accept;	/* list in "Accept:" for GET */
 };
 
 /*
@@ -272,6 +273,12 @@ extern void HTReorderPresentation PARAMS((
         HTFormat                format_out));
 
 /*
+ * Setup 'get_accept' flag to denote presentations that are not redundant,
+ * and will be listed in "Accept:" header.
+ */
+extern void HTFilterPresentations NOPARAMS;
+
+/*
 
 HTStackValue: Find the cost of a filter stack
 
diff --git a/WWW/Library/Implementation/HTMLDTD.c b/WWW/Library/Implementation/HTMLDTD.c
index 981bc989..cbdcff7a 100644
--- a/WWW/Library/Implementation/HTMLDTD.c
+++ b/WWW/Library/Implementation/HTMLDTD.c
@@ -1660,14 +1660,14 @@ PUBLIC CONST SGML_dtd HTML_dtd = {
    is limited and I didn't want to list the whole tags_new table
    twice... - kw */
 PUBLIC void HTSwitchDTD ARGS1(
-    BOOL,		new)
+    int,		new_flag)
 {
     if (TRACE)
 	CTRACE((tfp,"HTMLDTD: Copying DTD element info of size %d, %d * %d\n",
-		(int) (new ? sizeof(tags_new) : sizeof(tags_old)),
+		(int) (new_flag ? sizeof(tags_new) : sizeof(tags_old)),
 		HTML_ALL_ELEMENTS,
 		(int) sizeof(HTTag)));
-    if (new)
+    if (new_flag)
 	memcpy(tags, tags_new, HTML_ALL_ELEMENTS * sizeof(HTTag));
     else
 	memcpy(tags, tags_old, HTML_ALL_ELEMENTS * sizeof(HTTag));
diff --git a/WWW/Library/Implementation/HTMLDTD.h b/WWW/Library/Implementation/HTMLDTD.h
index 9c44e2c2..dd25b719 100644
--- a/WWW/Library/Implementation/HTMLDTD.h
+++ b/WWW/Library/Implementation/HTMLDTD.h
@@ -981,8 +981,7 @@ Attribute numbers
 #endif
 extern CONST SGML_dtd HTML_dtd;
 
-extern void HTSwitchDTD PARAMS((
-    BOOL new));
+extern void HTSwitchDTD PARAMS((int new_flag));
 
 extern HTTag HTTag_unrecognized;
 extern HTTag HTTag_mixedObject;
diff --git a/WWW/Library/Implementation/HTNews.c b/WWW/Library/Implementation/HTNews.c
index 19be48c8..2d8a8f5d 100644
--- a/WWW/Library/Implementation/HTNews.c
+++ b/WWW/Library/Implementation/HTNews.c
@@ -2175,7 +2175,7 @@ PRIVATE int HTLoadNews ARGS4(
 	**	xxxxx			News group (no "@")
 	**	group/n1-n2		Articles n1 to n2 in group
 	*/
-	normal_url = (!strncmp(arg, "news:", 5) || !strncmp(arg, "nntp:", 5));
+	normal_url = (BOOL) (!strncmp(arg, "news:", 5) || !strncmp(arg, "nntp:", 5));
 	spost_wanted = (BOOL) (!normal_url && strstr(arg, "snewspost:") != NULL);
 	sreply_wanted = (BOOL) (!(normal_url || spost_wanted) &&
 			 strstr(arg, "snewsreply:") != NULL);
diff --git a/WWW/Library/Implementation/HTString.c b/WWW/Library/Implementation/HTString.c
index fce10c6f..210eedcf 100644
--- a/WWW/Library/Implementation/HTString.c
+++ b/WWW/Library/Implementation/HTString.c
@@ -15,7 +15,7 @@
 
 #ifndef NO_LYNX_TRACE
 PUBLIC BOOLEAN WWW_TraceFlag = 0;	/* Global trace flag for ALL W3 code */
-PUBLIC unsigned WWW_TraceMask = 0;	/* Global trace flag for ALL W3 code */
+PUBLIC int WWW_TraceMask = 0;		/* Global trace flag for ALL W3 code */
 #endif
 
 #ifndef VC
@@ -454,13 +454,6 @@ PUBLIC char * HTNextTok ARGS4(
 		    get_closing_char_too = (BOOL) (strchr(bracks,*p) != NULL);
 	    } else
 	    break;			    /* kr95-10-9: needs to stop here */
-#if 0
-	} else if (*p == '<') {				     /* quoted field */
-	    if (!start) start = ++p;
-	    for(;*p && *p!='>'; p++)
-		if (*p == '\\' && *(p+1)) p++;	       /* Skip escaped chars */
-	    break;			    /* kr95-10-9: needs to stop here */
-#endif
 	} else {					      /* Spool field */
 	    if (!start) start = p;
 	    while(*p && !skipWHITE(*p) && !strchr(bracks,*p) &&
diff --git a/WWW/Library/Implementation/HTTCP.c b/WWW/Library/Implementation/HTTCP.c
index fca17ea5..fd916955 100644
--- a/WWW/Library/Implementation/HTTCP.c
+++ b/WWW/Library/Implementation/HTTCP.c
@@ -1208,12 +1208,12 @@ PRIVATE int HTParseInet ARGS2(
 	strptr = port;
 	if (port[0] >= '0' && port[0] <= '9') {
 #ifdef UNIX
-	    soc_in->sin_port = htons(strtol(port, &strptr, 10));
+	    soc_in->sin_port = (PortNumber)htons(strtol(port, &strptr, 10));
 #else /* VMS: */
 #ifdef DECNET
 	    soc_in->sdn_objnum = (unsigned char)(strtol(port, &strptr, 10));
 #else
-	    soc_in->sin_port = htons((unsigned short)strtol(port,&strptr,10));
+	    soc_in->sin_port = htons((PortNumber)strtol(port, &strptr, 10));
 #endif /* Decnet */
 #endif /* Unix vs. VMS */
 #ifdef SUPPRESS		/* 1. crashes!?!.  2. URL syntax has number not name */
@@ -1547,7 +1547,7 @@ PUBLIC int HTDoConnect ARGS4(
     */
     memset(soc_in, 0, sizeof(*soc_in));
     soc_in->sin_family = AF_INET;
-    soc_in->sin_port = htons((unsigned short) default_port);
+    soc_in->sin_port = htons((PortNumber) default_port);
 #endif /* INET6 */
 
     /*
diff --git a/WWW/Library/Implementation/HTTP.c b/WWW/Library/Implementation/HTTP.c
index 5e72f253..8e93fd80 100644
--- a/WWW/Library/Implementation/HTTP.c
+++ b/WWW/Library/Implementation/HTTP.c
@@ -639,39 +639,34 @@ use_tunnel:
       for (i = 0; i < n; i++) {
 	  HTPresentation *pres =
 			(HTPresentation *)HTList_objectAt(HTPresentations, i);
-	  if (pres->rep_out == WWW_PRESENT) {
-	      if (pres->rep != WWW_SOURCE &&
-		  strcasecomp(HTAtom_name(pres->rep), "www/mime") &&
-		  strcasecomp(HTAtom_name(pres->rep), "www/compressed") &&
-		  pres->quality <= 1.0 && pres->quality >= 0.0) {
-		  if (pres->quality < 1.0) {
-		      if (pres->maxbytes > 0) {
-			  sprintf(temp, ";q=%4.3f;mxb=%ld",
-					pres->quality, pres->maxbytes);
-		      } else {
-			  sprintf(temp, ";q=%4.3f", pres->quality);
-		      }
-		  } else if (pres->maxbytes > 0) {
-		      sprintf(temp, ";mxb=%ld", pres->maxbytes);
+	  if (pres->get_accept) {
+	      if (pres->quality < 1.0) {
+		  if (pres->maxbytes > 0) {
+		      sprintf(temp, ";q=%4.3f;mxb=%ld",
+				    pres->quality, pres->maxbytes);
 		  } else {
-		      temp[0] = '\0';
+		      sprintf(temp, ";q=%4.3f", pres->quality);
 		  }
-		  HTSprintf0(&linebuf, "%s%s%s",
-				(first_Accept ?
-				   "Accept: " : ", "),
+	      } else if (pres->maxbytes > 0) {
+		  sprintf(temp, ";mxb=%ld", pres->maxbytes);
+	      } else {
+		  temp[0] = '\0';
+	      }
+	      HTSprintf0(&linebuf, "%s%s%s",
+			    (first_Accept ?
+			       "Accept: " : ", "),
+			    HTAtom_name(pres->rep),
+			    temp);
+	      len += strlen(linebuf);
+	      if (len > 252 && !first_Accept) {
+		  StrAllocCat(command, crlf);
+		  HTSprintf0(&linebuf, "Accept: %s%s",
 				HTAtom_name(pres->rep),
 				temp);
-		  len += strlen(linebuf);
-		  if (len > 252 && !first_Accept) {
-		      StrAllocCat(command, crlf);
-		      HTSprintf0(&linebuf, "Accept: %s%s",
-				    HTAtom_name(pres->rep),
-				    temp);
-		      len = strlen(linebuf);
-		  }
-		  StrAllocCat(command, linebuf);
-		  first_Accept = FALSE;
+		  len = strlen(linebuf);
 	      }
+	      StrAllocCat(command, linebuf);
+	      first_Accept = FALSE;
 	  }
       }
       HTSprintf(&command, "%s*/*;q=0.01%c%c",
diff --git a/WWW/Library/Implementation/HTUtils.h b/WWW/Library/Implementation/HTUtils.h
index d387e2bd..80aed6fa 100644
--- a/WWW/Library/Implementation/HTUtils.h
+++ b/WWW/Library/Implementation/HTUtils.h
@@ -100,6 +100,8 @@
 #define HAVE_UTMP 1
 #endif
 
+#endif /* HAVE_CONFIG_H */
+
 #ifndef lynx_srand
 #define lynx_srand srand
 #endif
@@ -108,8 +110,6 @@
 #define lynx_rand rand
 #endif
 
-#endif /* HAVE_CONFIG_H */
-
 #if '0' != 48
 #define NOT_ASCII
 #endif
@@ -171,6 +171,10 @@ typedef unsigned short mode_t;
 #  define CAN_CUT_AND_PASTE
 #endif
 
+#if defined(USE_SLANG) || (defined(USE_COLOR_STYLE) && defined(__EMX__))
+#  define USE_BLINK
+#endif
+
 /*
 
   ERROR TYPE
@@ -489,7 +493,7 @@ The local equivalents of CR and LF
 #define LYTraceLogFP    0
 #else
 extern BOOLEAN WWW_TraceFlag;
-extern unsigned WWW_TraceMask;
+extern int WWW_TraceMask;
 #endif
 
 #define TRACE           (WWW_TraceFlag)
@@ -498,13 +502,13 @@ extern unsigned WWW_TraceMask;
 #define TRACE_TRST      (TRACE_bit(2))
 
 #if defined(LY_TRACELINE)
-#define LY_SHOWWHERE fprintf( tfp, "%s: %d: ", __FILE__, LY_TRACELINE );
+#define LY_SHOWWHERE fprintf( tfp, "%s: %d: ", __FILE__, LY_TRACELINE ),
 #else
 #define LY_SHOWWHERE /* nothing */
 #endif
 
-#define CTRACE(p)          if (TRACE) { LY_SHOWWHERE fprintf p; }
-#define CTRACE2(m,p)       if (m)     { LY_SHOWWHERE fprintf p; }
+#define CTRACE(p)         ((void)((TRACE) && ( LY_SHOWWHERE fprintf p )))
+#define CTRACE2(m,p)      ((void)((m)     && ( LY_SHOWWHERE fprintf p )))
 #define tfp TraceFP()
 #define CTRACE_SLEEP(secs) if (TRACE && LYTraceLogFP == 0) sleep(secs)
 #define CTRACE_FLUSH(fp)   if (TRACE) fflush(fp)
diff --git a/WWW/Library/Implementation/HTVMSUtils.c b/WWW/Library/Implementation/HTVMSUtils.c
index d7019411..d4b37a76 100644
--- a/WWW/Library/Implementation/HTVMSUtils.c
+++ b/WWW/Library/Implementation/HTVMSUtils.c
@@ -383,14 +383,6 @@ static char *Name;
 #endif	/* !_POSIX_SOURCE */
 
 typedef	struct __dirdesc {
-#if 0
-	int	dd_fd;		/* file descriptor */
-	long	dd_loc;		/* buf offset of entry from last readddir() */
-	long	dd_size;	/* amount of valid data in buffer */
-	long	dd_bsize;	/* amount of entries read at a time */
-	long	dd_off;		/* Current offset in dir (for telldir) */
-	char	*dd_buf;	/* directory data buffer */
-#endif
 	long	context;	/* context descriptor for LIB$FIND_FILE calls */
 	char	dirname[255+1];	/* keeps the directory name, including *.* */
 	struct dsc$descriptor_s dirname_desc;	/* descriptor of dirname */
@@ -399,28 +391,11 @@ typedef	struct __dirdesc {
 PRIVATE	DIR *HTVMSopendir(char *dirname);
 PRIVATE	struct dirent *HTVMSreaddir(DIR *dirp);
 PRIVATE	int HTVMSclosedir(DIR *dirp);
-#if 0
-#ifndef	_POSIX_SOURCE
-extern	void seekdir(/* DIR *dirp, int loc */);
-extern	long telldir(/* DIR *dirp */);
-#endif	/* POSIX_SOURCE */
-extern	void rewinddir(/* DIR *dirp */);
-
-#ifndef	lint
-#define	rewinddir(dirp)	seekdir((dirp), (long)0)
-#endif
-#endif /* not defined for VMS */
 
 /*** #include <sys_dirent.h> ***/
 /*** "sys_dirent.h" ***/
 struct	dirent {
-#if 0
-	off_t		d_off;		/* offset of next disk dir entry */
-#endif
 	unsigned long	d_fileno;	/* file number of entry */
-#if 0
-	unsigned short	d_reclen;	/* length of this record */
-#endif
 	unsigned short	d_namlen;	/* length of string in d_name */
 	char		d_name[255+1];	/* name (up to MAXNAMLEN + 1) */
 };
diff --git a/WWW/Library/Implementation/HTWAIS.c b/WWW/Library/Implementation/HTWAIS.c
index 7d440e7f..30b06ea5 100644
--- a/WWW/Library/Implementation/HTWAIS.c
+++ b/WWW/Library/Implementation/HTWAIS.c
@@ -299,7 +299,7 @@ PRIVATE char * WWW_from_WAIS ARGS1(
 	l = *p++;		/* Length */
 	for (i = 0; i < l; i++, p++){
 	    if (!acceptable[*p]) {
-		*q++ = HEX_ESCAPE;	/* Means hex commming */
+		*q++ = HEX_ESCAPE;	/* Means hex coming */
 		*q++ = hex[(*p) >> 4];
 		*q++ = hex[(*p) & 15];
 	    }
@@ -457,7 +457,7 @@ PRIVATE void display_search_response ARGS4(
     WAISSearchResponse	*info;
     long i, k;
 
-    BOOL archie =  strstr(database, "archie")!=0;	/* Specical handling */
+    BOOL archie =  strstr(database, "archie")!=0;	/* Special handling */
 
     CTRACE((tfp, "HTWAIS: Displaying search response\n"));
     PUTS(gettext("Index "));
@@ -613,8 +613,6 @@ PUBLIC int HTLoadWAIS ARGS4(
 #define MAXDOCS 200
 
 {
-    static CONST char * error_header =
-"<h1>Access error</h1>\nThe following error occured in accesing a WAIS server:<P>\n";
     char * key;			  /* pointer to keywords in URL */
     char* request_message = NULL; /* arbitrary message limit */
     char* response_message = NULL; /* arbitrary message limit */
@@ -647,7 +645,7 @@ PUBLIC int HTLoadWAIS ARGS4(
     /*	Decipher and check syntax of WWW address:
     **	----------------------------------------
     **
-    **	First we remove the "wais:" if it was spcified.  920110
+    **	First we remove the "wais:" if it was specified.  920110
     */
     names = HTParse(arg, "", PARSE_HOST | PARSE_PATH | PARSE_PUNCTUATION);
     key = strchr(names, '?');
diff --git a/WWW/Library/Implementation/HTWSRC.c b/WWW/Library/Implementation/HTWSRC.c
index 0f7577f8..9d69669b 100644
--- a/WWW/Library/Implementation/HTWSRC.c
+++ b/WWW/Library/Implementation/HTWSRC.c
@@ -22,8 +22,6 @@
 #define PARAM_MAX BIG
 #define CACHE_PERIOD (7*86400)	/* Time to keep .src file in seconds */
 
-#define HEX_ESCAPE '%'
-
 struct _HTStructured {
 	CONST HTStructuredClass *	isa;
 	/* ... */
diff --git a/WWW/Library/Implementation/HText.h b/WWW/Library/Implementation/HText.h
index 6aa336dc..b1a11ba4 100644
--- a/WWW/Library/Implementation/HText.h
+++ b/WWW/Library/Implementation/HText.h
@@ -83,7 +83,7 @@ extern void HText_setStyle PARAMS((HText * text, HTStyle * style));
   ADD ONE CHARACTER
 
  */
-extern void HText_appendCharacter PARAMS((HText * text, char ch));
+extern void HText_appendCharacter PARAMS((HText * text, int ch));
 
 /*
 
diff --git a/WWW/Library/Implementation/SGML.c b/WWW/Library/Implementation/SGML.c
index fdc492b1..09f6c4b0 100644
--- a/WWW/Library/Implementation/SGML.c
+++ b/WWW/Library/Implementation/SGML.c
@@ -39,12 +39,6 @@
 # include <LYPrettySrc.h>
 #endif
 
-#if 0
-#ifdef CJK_EX	/* 1997/12/12 (Fri) 16:54:58 */
-extern HTkcode last_kcode;
-#endif
-#endif
-
 #define INVALID (-1)
 
 #ifdef USE_PRETTYSRC
@@ -1005,13 +999,6 @@ PRIVATE void end_element ARGS2(
 		do_close_stacked(context);
 		extra_action_taken = YES;
 		stackpos = is_on_stack(context, old_tag);
-#if 0	/* done below with more specific message - kw */
-	    } else {
-		CTRACE((tfp, "SGML: Still open %s \t<- ***invalid end </%s>\n",
-			    context->element_stack->tag->name,
-			    old_tag->name));
-		return;
-#endif
 	    }
 	}
 
@@ -1476,10 +1463,6 @@ PRIVATE void SGML_character ARGS2(
     **	we can revert back to the unchanged c_in. - KW
     */
 #define unsign_c clong
-#if 0
-    static unsigned char sjis_1st = '\0';
-    unsigned char sjis_hi, sjis_lo;
-#endif
 
     c = c_in;
     clong = UCH(c);	/* a.k.a. unsign_c */
@@ -1693,29 +1676,6 @@ top1:
 	HTCJK == NOCJK)
 	goto after_switch;
 
-#if 0	/* This JIS X0201 Kana to JIS X0208 Kana conversion is/should be
-	 * done in the HTextAppendCharacter. -- TH
-	 */
-#ifdef CJK_EX	/* 1998/11/24 (Tue) 17:02:31 */
-    if (HTCJK == JAPANESE && last_kcode == SJIS) {
-	if (sjis_1st == '\0' && (IS_SJIS_HI1(c) || IS_SJIS_HI2(c))) {
-	    sjis_1st = c;
-	} else if (sjis_1st && IS_SJIS_LO(c)) {
-	    sjis_1st = '\0';
-	} else {
-	    if (context->state == S_text) {
-		if (0xA1 <= UCH(c) && UCH(c) <= 0xDF) {
-		    JISx0201TO0208_SJIS(c, &sjis_hi, &sjis_lo);
-		    PUTC(sjis_hi);
-		    PUTC(sjis_lo);
-		    goto after_switch;
-		}
-	    }
-	}
-    }
-#endif
-#endif
-
     /*
     **	Ignore 127 if we don't have HTPassHighCtrlRaw
     **	or HTCJK set. - FM
@@ -3495,7 +3455,7 @@ top1:
 		break;
 	    }
 #ifdef USE_PRETTYSRC
-	    }  else {
+	    } else {
 		PUTC(' ');
 		if (context->current_attribute_number == INVALID)
 		    PSRCSTART(badattr);
@@ -3561,22 +3521,19 @@ top1:
 	    context->state = S_equals;
 	    break;
 	}
-#ifdef USE_PRETTYSRC
-#if 0 /*seems this is not needed. It was causing some LSS style stack underflow -VH*/
-	/* we are here because this char seemed the beginning of attrname */
-	if (psrc_view && context->current_attribute_number == INVALID) {
-	    PSRCSTOP(badattr);
-	    PUTC(' ');
-	}
-#endif
-#endif
 	HTChunkPutc(string, c);
 	context->state = S_attr; /* Get next attribute */
 	break;
 
     case S_equals:		/* After attr = */
-	if (WHITE(c))
+	if (WHITE(c)) {
+	    CTRACE((tfp, "SGML: found = but no value\n"));
+	    HTChunkTerminate(string) ;
+	    handle_attribute_value(context, string->data);
+	    string->size = 0;
+	    PUTC(c);
 	    break;		/* Before attribute value */
+	}
 	if (c == '>') {		/* End of tag */
 	    CTRACE((tfp, "SGML: found = but no value\n"));
 #ifdef USE_PRETTYSRC
@@ -4803,121 +4760,6 @@ PRIVATE CONST unsigned char *repairJIStoEUC ARGS2(
     return 0;
 }
 
-#if 0	/* NOTUSED */
-
-static struct {
-    char *ee;
-    char de;
-} entities[] = {
-    {"&lt;", '<' },
-    {"&gt;", '>' },
-    {"&amp;", '&'},
-    {"&quot;", '"'},
-    {NULL, 0}
-};
-
-PRIVATE int isHTMLentity ARGS2(
-	char *, str,
-	int *, chp)
-{
-    int ei, ej;
-    char *es, ec;
-    int off;
-
-    off = *str == '&' ? 0 : 1;
-    for (ei = 0; (es = entities[ei].ee) != '\0'; ei++) {
-	for (ej = 0; (ec = es[off + ej]) != '\0'; ej++) {
-	    if (ec != str[ej])
-		break;
-	    if (ec == ';') {
-		*chp = entities[ei].de;
-		return ej + 1;
-	    }
-	}
-    }
-    return 0;
-}
-
-#define sputc(sp,ch)	(sp?(*sp++ = ch):ch)
-
-PUBLIC int FIX_2022 ARGS3(
-	char *, src,
-	char *, dst,
-	char *, ctype)
-{
-    int in2B;
-    char ch1, ch2, *sp, *dp;
-    int bad;
-    int isHTML, len, ech;
-
-    in2B = 0;
-    sp = src;
-    dp = dst;
-    bad = 0;
-
-    isHTML = strcasecomp(ctype, "text/html") == 0;
-
-    while ((ch1 = *sp++) != '\0') {
-	if (ch1 == ESC) {
-	    if (*sp == TO_2BCODE) {
-		if (sp[1] == 'B' || sp[1] == '@') {
-		    in2B = 1;
-		    sputc(dp, ch1);
-		    sputc(dp, *sp++);
-		    sputc(dp, *sp++);
-		    continue;
-		}
-	    } else if (*sp == TO_1BCODE) {
-		if (sp[1] == 'B' || sp[1] == 'J') {
-		    in2B = 0;
-		    sputc(dp, ch1);
-		    sputc(dp, *sp++);
-		    sputc(dp, *sp++);
-		    continue;
-		}
-	    }
-	}
-	if (in2B) {
-	    if ((ch1 <= 0x20)
-		|| (sp[0] <= 0x20)
-		|| (ch1 == '<' && sp[0] == '/')
-		|| (sp[0] == '<' && sp[1] == '/')) {
-		in2B = 0;
-		sputc(dp, ESC);
-		sputc(dp, TO_1BCODE);
-		sputc(dp, 'B');
-		sputc(dp, ch1);
-		bad = 1;
-		continue;
-	    }
-	    if (isHTML && ch1 == '&')
-		if ((len = isHTMLentity(sp, &ech)) != '\0')
-		    if (sp[len] != 0) {
-			ch1 = ech;
-			sp += len;
-			bad = 1;
-		    }
-	    ch2 = *sp++;
-
-	    if (isHTML && ch2 == '&')
-		if ((len = isHTMLentity(sp, &ech)) != '\0')
-		    if (sp[len] != 0) {
-			ch2 = ech;
-			sp += len;
-			bad = 1;
-		    }
-	    sputc(dp, ch1);
-	    sputc(dp, ch2);
-	} else {
-	    sputc(dp, ch1);
-	}
-    }
-    sputc(dp, 0);
-    return bad;
-}
-
-#endif
-
 PUBLIC unsigned char *TO_EUC ARGS2(
 	CONST unsigned char *,	jis,
 	unsigned char *,	euc)
@@ -5065,12 +4907,6 @@ PUBLIC void TO_JIS ARGS2(
 	outofmem(__FILE__, "TO_JIS");
 #endif
     TO_EUC(any, euc);
-#if 0
-    if (is_EUC_JP(euc))
-	EUC_TO_JIS(euc, jis, TO_KANJI, TO_ASCII);
-    else
-	strcpy(jis, any);
-#endif
     is_EUC_JP(euc);
     EUC_TO_JIS(euc, jis, TO_KANJI, TO_ASCII);
 
diff --git a/WWW/Library/Implementation/www_tcp.h b/WWW/Library/Implementation/www_tcp.h
index 4ab53b08..9de8ea51 100644
--- a/WWW/Library/Implementation/www_tcp.h
+++ b/WWW/Library/Implementation/www_tcp.h
@@ -71,6 +71,7 @@ Default values
 #endif /* DJGPP or __BORLANDC__ */
 
 #if defined(_MSC_VER)
+#undef HAVE_DIRENT_H
 #define HAVE_DIRENT_H
 #undef HAVE_SYS_FILIO_H
 #endif /* _MSC_VER */
@@ -191,9 +192,8 @@ extern int ws_netread(int fd, char *buf, int len);
 #include <errno.h>
 #include <direct.h>
 
-/* FIXME: someone might consider porting to winsock2.h */
 #ifdef USE_WINSOCK2_H
-#include <winsock.h>
+#include <winsock2.h>		/* normally included in windows.h */
 
 #undef EINPROGRESS
 #undef EALREADY
@@ -680,6 +680,8 @@ typedef int pid_t;
 #include <libintl.h>
 #endif
 
+#define N_(s) (s)
+
 #ifndef HAVE_GETTEXT
 #define gettext(s) s
 #endif
@@ -701,6 +703,8 @@ Defaults
 #include <netdb.h>
 #endif  /* TCP includes */
 
+typedef unsigned short PortNumber;
+
 #ifndef S_ISLNK
 #define S_ISLNK(m)	(((m) & S_IFMT) == S_IFLNK)
 #endif /* S_ISLNK */
diff --git a/WWW/Library/djgpp/CommonMakefile b/WWW/Library/djgpp/CommonMakefile
index 2e619687..99dc1f6a 100644
--- a/WWW/Library/djgpp/CommonMakefile
+++ b/WWW/Library/djgpp/CommonMakefile
@@ -143,13 +143,12 @@ $(LOB)/libwww.a : $(COMMON)
 
 #	Clean up everything generatable except final products
 clean :
-	rm $(LOB)/*.o
-	-rmdir $(LOB)
+	rm -f $(LOB)/*.o
 
 #	Clean up everything generatable including final products
 
 cleanall : clean
-	rm $(LOB)/libwww.a
+	rm -f $(LOB)/libwww.a
 
 #	Install W3 library into system space (not normally necessary)
 
diff --git a/WWW/Library/djgpp/makefile b/WWW/Library/djgpp/makefile
index 78567d28..893f6cdb 100644
--- a/WWW/Library/djgpp/makefile
+++ b/WWW/Library/djgpp/makefile
@@ -13,21 +13,39 @@ WWW_MACH = djgpp
  -DUSE_HASH \
  -DLINKEDSTYLES
 
+# comment this line to suppress DIRED support
+DIRED_DEFS = -DDIRED_SUPPORT
 
-CFLAGS = -O1 -DUSE_ZLIB -DDOSPATH -DNOUSERS -DDISP_PARTIAL \
--DDIRED_SUPPORT -DSOURCE_CACHE -DUSE_PRETTYSRC \
+CFLAGS= -O2 $(MCFLAGS) $(INTLFLAGS) $(SSLFLAGS) $(SSLINC)
+
+MCFLAGS = \
+ $(DIRED_DEFS) \
  $(ENABLE_COLOR_STYLE) \
--DEXP_FILE_UPLOAD \
--DWATT32 \
--I../Implementation \
--I../../../djgpp/watt32/inc -I../../../djgpp/watt32/inc/sys \
--I../../../src \
--I../../../curses \
--I../../.. $(INTLFLAGS)
+ -DDISP_PARTIAL \
+ -DDOSPATH \
+ -DEXP_FILE_UPLOAD \
+ -DNOUSERS \
+ -DSOURCE_CACHE \
+ -DUSE_PRETTYSRC \
+ -DUSE_ZLIB \
+ -DWATT32 \
+ -I../Implementation \
+ -I../../../src \
+ -I../../.. \
+ -I/djgpp/pdcur24 \
+ -I/djgpp/watt32/inc \
+ -I/djgpp/watt32/inc/sys
+
 LFLAGS =
 CC = gcc
+
+# Uncomment the following to enable Internationalization.
 #INTLFLAGS = -DHAVE_GETTEXT -DHAVE_LIBINTL_H
 
+# Uncomment the following to enable SSL.
+#SSLFLAGS = -DUSE_SSL
+#SSLINC = -I/djgpp/include/openssl
+
 # Directory for installed binary:
 !BINDIR = /usr/local/bin