about summary refs log tree commit diff stats
path: root/WWW
diff options
context:
space:
mode:
Diffstat (limited to 'WWW')
-rw-r--r--WWW/Library/Implementation/HTAABrow.c11
-rw-r--r--WWW/Library/Implementation/HTAAUtil.c1
-rw-r--r--WWW/Library/Implementation/HTAccess.c13
-rw-r--r--WWW/Library/Implementation/HTCJK.h12
-rw-r--r--WWW/Library/Implementation/HTChunk.c10
-rw-r--r--WWW/Library/Implementation/HTFTP.c11
-rw-r--r--WWW/Library/Implementation/HTFile.c9
-rw-r--r--WWW/Library/Implementation/HTFormat.c5
-rw-r--r--WWW/Library/Implementation/HTGopher.c44
-rw-r--r--WWW/Library/Implementation/HTMIME.c3
-rw-r--r--WWW/Library/Implementation/HTPlain.c20
-rw-r--r--WWW/Library/Implementation/HTRules.c8
-rw-r--r--WWW/Library/Implementation/HTString.c5
-rw-r--r--WWW/Library/Implementation/HTTCP.c4
-rw-r--r--WWW/Library/Implementation/HTTCP.h2
-rw-r--r--WWW/Library/Implementation/HTTP.c4
-rw-r--r--WWW/Library/Implementation/HTTelnet.c127
-rw-r--r--WWW/Library/Implementation/HTUU.c10
-rw-r--r--WWW/Library/Implementation/HTVMSUtils.c269
-rw-r--r--WWW/Library/Implementation/HTVMS_WaisProt.c4
-rw-r--r--WWW/Library/Implementation/HTVMS_WaisUI.c50
-rw-r--r--WWW/Library/Implementation/HTWAIS.c6
-rw-r--r--WWW/Library/Implementation/SGML.c35
-rw-r--r--WWW/Library/Implementation/crypt_util.c6
-rw-r--r--WWW/Library/djgpp/makefile4
-rw-r--r--WWW/Library/djgpp/makefile.sla4
26 files changed, 355 insertions, 322 deletions
diff --git a/WWW/Library/Implementation/HTAABrow.c b/WWW/Library/Implementation/HTAABrow.c
index 20ee00d1..0db66cbb 100644
--- a/WWW/Library/Implementation/HTAABrow.c
+++ b/WWW/Library/Implementation/HTAABrow.c
@@ -428,9 +428,10 @@ PRIVATE void HTAASetup_delete ARGS1(
 
     if (killme) {
 	FREE(killme->template);
-	if (killme->valid_schemes)
+	if (killme->valid_schemes) {
 	    HTList_delete(killme->valid_schemes);
 	    killme->valid_schemes = NULL;
+	}
 	for (scheme = 0; scheme < HTAA_MAX_SCHEMES; scheme++)
 	    if (killme->scheme_specifics[scheme])
 		HTAssocList_delete(killme->scheme_specifics[scheme]);
@@ -630,10 +631,10 @@ PRIVATE char *compose_auth_string ARGS3(
 	 */
 	if (!theHost)
 	    theHost = setup->server->hostname;
-	    if (setup->server->portnumber > 0 &&
-		setup->server->portnumber != 80) {
-		HTSprintf0(&thePort, ":%d", setup->server->portnumber);
-	    }
+	if (setup->server->portnumber > 0 &&
+	    setup->server->portnumber != 80) {
+	    HTSprintf0(&thePort, ":%d", setup->server->portnumber);
+	}
 	/*
 	 *  Set up the message for the username prompt,
 	 *  and then issue the prompt.  The default
diff --git a/WWW/Library/Implementation/HTAAUtil.c b/WWW/Library/Implementation/HTAAUtil.c
index dae785c9..ecfb04e1 100644
--- a/WWW/Library/Implementation/HTAAUtil.c
+++ b/WWW/Library/Implementation/HTAAUtil.c
@@ -48,6 +48,7 @@
 #include <HTAAUtil.h>	/* Implemented here	*/
 #include <HTAssoc.h>	/* Assoc list		*/
 #include <HTTCP.h>
+#include <HTTP.h>
 
 #include <LYStrings.h>
 #include <LYLeaks.h>
diff --git a/WWW/Library/Implementation/HTAccess.c b/WWW/Library/Implementation/HTAccess.c
index 9010cf26..21e59efa 100644
--- a/WWW/Library/Implementation/HTAccess.c
+++ b/WWW/Library/Implementation/HTAccess.c
@@ -269,15 +269,16 @@ PUBLIC BOOL override_proxy ARGS1(
     }
     Host = (((at = strchr(host, '@')) != NULL) ? (at+1) : host);
 
-    if ((acc_method = HTParse(addr, "", PARSE_ACCESS))) {
-	if (!strcmp("file", acc_method) &&
-	    (!strcmp(Host, "localhost") ||
 #ifdef VMS
-	     !strcasecomp(Host, HTHostName())
+#define CompareHostname(a,b) strcasecomp(a, b)
 #else
-	     !strcmp(Host, HTHostName())
+#define CompareHostname(a,b) strcmp(a, b)
 #endif /* VMS */
-	)) {
+
+    if ((acc_method = HTParse(addr, "", PARSE_ACCESS))) {
+	if (!strcmp("file", acc_method) &&
+	    (!strcmp(Host, "localhost") ||
+	     !CompareHostname(Host, HTHostName()))) {
 	    FREE(host);
 	    FREE(acc_method);
 	    return YES;
diff --git a/WWW/Library/Implementation/HTCJK.h b/WWW/Library/Implementation/HTCJK.h
index 8858085a..5c2908f0 100644
--- a/WWW/Library/Implementation/HTCJK.h
+++ b/WWW/Library/Implementation/HTCJK.h
@@ -37,11 +37,21 @@
 #define IS_SJIS_HI1(hi) ((0x81<=hi)&&(hi<=0x9F))	/* 1st lev. */
 #define IS_SJIS_HI2(hi) ((0xE0<=hi)&&(hi<=0xEF))	/* 2nd lev. */
 #define IS_SJIS(hi,lo,in_sjis) (!IS_SJIS_LO(lo)?0:IS_SJIS_HI1(hi)?(in_sjis=1):in_sjis&&IS_SJIS_HI2(hi))
+#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(hi,lo) (IS_EUC_HI(hi) && (IS_EUC_LOS(lo) || IS_EUC_LOX(lo)))
+#define IS_EUC_X0201KANA(hi,lo) ((hi==0x8E)&&(0xA1<=lo)&&(lo<=0xDF))
+#define IS_EUC(hi,lo) ((IS_EUC_HI(hi) && IS_EUC_LOX(lo))||IS_EUC_X0201KANA(hi,lo))
+
+#define IS_JAPANESE_2BYTE(hi,lo) (IS_SJIS_2BYTE(hi,lo) || IS_EUC(hi,lo))
 
 #define IS_BIG5_LOS(lo)	((0x40<=lo)&&(lo<=0x7E))	/* standard */
 #define IS_BIG5_LOX(lo)	((0xA1<=lo)&&(lo<=0xFE))	/* extended */
diff --git a/WWW/Library/Implementation/HTChunk.c b/WWW/Library/Implementation/HTChunk.c
index d38c5808..fc9288da 100644
--- a/WWW/Library/Implementation/HTChunk.c
+++ b/WWW/Library/Implementation/HTChunk.c
@@ -138,8 +138,8 @@ PUBLIC void HTChunkPutb ARGS3 (HTChunk *,ch, CONST char *,b, int,l)
 	if (data) {
 	    ch->data = data;
 	} else if (ch->failok) {
-	   HTChunkClear(ch);	/* allocation failed, clear all data - kw */
-	   return;		/* caller should check ch->allocated - kw */
+	    HTChunkClear(ch);	/* allocation failed, clear all data - kw */
+	    return;		/* caller should check ch->allocated - kw */
 	} else {
 	    outofmem(__FILE__, "HTChunkPutb");
 	}
@@ -208,18 +208,24 @@ PUBLIC void HTChunkPutUtf8Char ARGS2(
 	break;
     case 6:
 	PUTC(0xfc | (code>>30));
+	break;
     }
     switch (utflen) {
     case 6:
 	PUTC2(code>>24);
+	/* FALLTHRU */
     case 5:
 	PUTC2(code>>18);
+	/* FALLTHRU */
     case 4:
 	PUTC2(code>>12);
+	/* FALLTHRU */
     case 3:
 	PUTC2(code>>6);
+	/* FALLTHRU */
     case 2:
 	PUTC2(code);
+	break;
     }
 }
 
diff --git a/WWW/Library/Implementation/HTFTP.c b/WWW/Library/Implementation/HTFTP.c
index cd6d5b57..20cafe2e 100644
--- a/WWW/Library/Implementation/HTFTP.c
+++ b/WWW/Library/Implementation/HTFTP.c
@@ -1138,15 +1138,16 @@ PRIVATE int get_listen_socket NOARGS
 #ifndef SHORTENED_RBIND
 			,socks_bind_remoteAddr
 #endif /* !SHORTENED_RBIND */
-						)) == 0)
+						)) == 0) {
 		    break;
-	    else
+		} else
 #endif /* SOCKS */
 	    if ((status=bind(new_socket,
 		    (struct sockaddr*)&soc_address,
 			    /* Cast to generic sockaddr */
-		    sizeof(soc_address))) == 0)
+		    sizeof(soc_address))) == 0) {
 		break;
+	    }
 	    CTRACE((tfp, "TCP bind attempt to port %d yields %d, errno=%d\n",
 		port_number, status, SOCKET_ERRNO));
 	} /* for */
@@ -1433,6 +1434,7 @@ PRIVATE void parse_eplf_line ARGS2(
 		break;
 	    case '/':
 		StrAllocCopy(info->type, ENTRY_IS_DIRECTORY);
+		/* FALLTHRU */
 	    default:
 		while (*cp) {
 		    if (*cp++ == ',')
@@ -2851,9 +2853,6 @@ unload_btree:
 	_HTProgress(TRANSFER_INTERRUPTED);
     }
     return HT_LOADED;
-#ifdef NOTDEFINED
-    return response(NIL) == 2 ? HT_LOADED : -1;
-#endif /* NOTDEFINED */
 }
 
 /*	Retrieve File from Server
diff --git a/WWW/Library/Implementation/HTFile.c b/WWW/Library/Implementation/HTFile.c
index 4ecf8820..20cda536 100644
--- a/WWW/Library/Implementation/HTFile.c
+++ b/WWW/Library/Implementation/HTFile.c
@@ -24,6 +24,7 @@
 
 #ifndef VMS
 #ifdef DOSPATH
+#undef LONG_LIST
 #define LONG_LIST  /* Define this for long style unix listings (ls -l),
 		     the actual style is configurable from lynx.cfg */
 #endif
@@ -1215,9 +1216,7 @@ PUBLIC float HTFileValue ARGS1(
 PUBLIC BOOL HTEditable ARGS1(
 	CONST char *,	filename)
 {
-#ifdef NO_GROUPS
-    return NO;		/* Safe answer till we find the correct algorithm */
-#else
+#ifndef NO_GROUPS
     GETGROUPS_T groups[NGROUPS];
     uid_t	myUid;
     int		ngroups;			/* The number of groups	 */
@@ -1259,8 +1258,8 @@ PUBLIC BOOL HTEditable ARGS1(
 	}
     }
     CTRACE((tfp, "\tFile is not editable.\n"));
-    return NO;					/* If no excuse, can't do */
 #endif /* NO_GROUPS */
+    return NO;					/* If no excuse, can't do */
 }
 
 /*	Make a save stream.
@@ -2317,7 +2316,7 @@ PUBLIC int HTLoadFile ARGS4(
 	    BOOL forget_multi = NO;
 
 	    STRUCT_DIRENT * dirbuf;
-	    float best = NO_VALUE_FOUND;	/* So far best is bad */
+	    float best = (float) NO_VALUE_FOUND; /* So far best is bad */
 	    HTFormat best_rep = NULL;	/* Set when rep found */
 	    HTAtom * best_enc = NULL;
 	    char * best_name = NULL;	/* Best dir entry so far */
diff --git a/WWW/Library/Implementation/HTFormat.c b/WWW/Library/Implementation/HTFormat.c
index 3c000cea..b4def6e6 100644
--- a/WWW/Library/Implementation/HTFormat.c
+++ b/WWW/Library/Implementation/HTFormat.c
@@ -36,6 +36,7 @@ PUBLIC long int HTMaxBytes  = 0;	/* No effective limit */
 #include <HTList.h>
 #include <HTInit.h>
 #include <HTTCP.h>
+#include <HTTP.h>
 /*	Streams and structured streams which we use:
 */
 #include <HTFWriter.h>
@@ -498,7 +499,7 @@ PUBLIC float HTStackValue ARGS4(
 	}
     }
 
-    return -1e30;		/* Really bad */
+    return (float) -1e30;	/* Really bad */
 
 }
 
@@ -1006,7 +1007,7 @@ PUBLIC void HTCopyNoCR ARGS3(
 	character = HTGetCharacter();
 	if (character == EOF)
 	    break;
-	(*targetClass.put_character)(sink, character);
+	(*targetClass.put_character)(sink, (unsigned char) character);
     }
 }
 
diff --git a/WWW/Library/Implementation/HTGopher.c b/WWW/Library/Implementation/HTGopher.c
index f934662f..f92fcb49 100644
--- a/WWW/Library/Implementation/HTGopher.c
+++ b/WWW/Library/Implementation/HTGopher.c
@@ -981,28 +981,30 @@ PRIVATE int parse_cso_fields ARGS2(
 		**  multiple digits (infinite?).
 		*/
 
-	    /*
-	    **	Check status, ignore any non-success.
-	    */
-	    if (p[1] != '2' )
-		continue;
+		/*
+		** Check status, ignore any non-success.
+		*/
+		if (p[1] != '2' )
+		    continue;
 
-	    /*
-	    **	Parse fields within returned line into status, ndx, name, data.
-	    */
-	    indx = NULL;
-	    name = NULL;
-	    for (i = 0; p[i]; i++)
-		if (p[i] == ':' ) {
-		    p[i] = '\0';
-		    if (!indx) {
-			indx = (char *)&p[i+1];
-			code = atoi (indx);
-		    } else if (!name) {
-			name = (char *)&p[i+1];
-		    } else {
-		       i++;
-		       break;
+		/*
+		** Parse fields within returned line into status, ndx, name,
+		** data.
+		*/
+		indx = NULL;
+		name = NULL;
+		for (i = 0; p[i]; i++) {
+		    if (p[i] == ':' ) {
+			p[i] = '\0';
+			if (!indx) {
+			    indx = (char *)&p[i+1];
+			    code = atoi (indx);
+			} else if (!name) {
+			    name = (char *)&p[i+1];
+			} else {
+			    i++;
+			    break;
+			}
 		    }
 		}
 		/*
diff --git a/WWW/Library/Implementation/HTMIME.c b/WWW/Library/Implementation/HTMIME.c
index 341a2da7..48d3b55a 100644
--- a/WWW/Library/Implementation/HTMIME.c
+++ b/WWW/Library/Implementation/HTMIME.c
@@ -981,8 +981,7 @@ PRIVATE void HTMIME_put_character ARGS2(
 	     * act on it. - kw */
 	    dispatchField(me);
 	}
-
-	/*	else Falls through */
+	/* FALLTHRU */
 
     case miBEGINNING_OF_LINE:
 	me->net_ascii = YES;
diff --git a/WWW/Library/Implementation/HTPlain.c b/WWW/Library/Implementation/HTPlain.c
index 968ded4c..c3b2a484 100644
--- a/WWW/Library/Implementation/HTPlain.c
+++ b/WWW/Library/Implementation/HTPlain.c
@@ -597,11 +597,11 @@ PRIVATE void HTPlain_write ARGS3(HTStream *, me, CONST char*, s, int, l)
 	    */
 	    HText_appendCharacter(me->text, (char)(*p & 0x7f));
 #endif /* NOTDEFINED */
-	   /*
-	   **  If we don't actually want the character,
-	   **  make it safe and output that now. - FM
-	   */
-	   } else if ((c_unsign > 0 &&
+	    /*
+	    **  If we don't actually want the character,
+	    **  make it safe and output that now. - FM
+	    */
+	} else if ((c_unsign > 0 &&
 		      (int) c_unsign < LYlowest_eightbit[me->outUCLYhndl]) ||
 		      (me->T.trans_from_uni && !HTPassEightBitRaw)) {
 	    /*
@@ -618,9 +618,9 @@ PRIVATE void HTPlain_write ARGS3(HTStream *, me, CONST char*, s, int, l)
 		/*
 		**  Got an ASCII character (yippey). - FM
 		*/
-	    c = FROMASCII((char)uck);
-	    HText_appendCharacter(me->text, c);
-	} else if ((chk && uck == -4) &&
+		c = FROMASCII((char)uck);
+		HText_appendCharacter(me->text, c);
+	    } else if ((chk && uck == -4) &&
 		       (uck = UCTransUniCharStr(replace_buf,
 						60, code,
 						UCGetLYhndl_byMIME("us-ascii"),
@@ -653,8 +653,8 @@ PRIVATE void HTPlain_write ARGS3(HTStream *, me, CONST char*, s, int, l)
 		**  pass it. - FM
 		*/
 	} else if (c_unsign != 0 && c_unsign < 256) {
-		HText_appendCharacter(me->text, c);
-	    }
+	    HText_appendCharacter(me->text, c);
+	}
 #endif /* REMOVE_CR_ONLY */
     }
 }
diff --git a/WWW/Library/Implementation/HTRules.c b/WWW/Library/Implementation/HTRules.c
index 48263a34..cc36e8d7 100644
--- a/WWW/Library/Implementation/HTRules.c
+++ b/WWW/Library/Implementation/HTRules.c
@@ -472,16 +472,16 @@ PUBLIC int  HTSetConfiguration ARGS1(
 	else status = 0;
 	HTSetSuffix(word2,	word3,
 				encoding ? encoding : "binary",
-				status >= 1? quality : 1.0);
+				status >= 1? quality : (float) 1.0);
 
     } else if (0==strcasecomp(word1, "presentation")) {
 	if (pointer) status = sscanf(pointer, "%f%f%f%d",
 			    &quality, &secs, &secs_per_byte, &maxbytes);
 	else status = 0;
 	HTSetPresentation(word2, word3,
-		    status >= 1 ? quality		: 1.0,
-		    status >= 2 ? secs			: 0.0,
-		    status >= 3 ? secs_per_byte 	: 0.0,
+		    status >= 1 ? quality		: (float) 1.0,
+		    status >= 2 ? secs			: (float) 0.0,
+		    status >= 3 ? secs_per_byte 	: (float) 0.0,
 		    status >= 4 ? maxbytes		: 0 );
 
     } else if (0==strncasecomp(word1, "htbin", 5) ||
diff --git a/WWW/Library/Implementation/HTString.c b/WWW/Library/Implementation/HTString.c
index e7e31218..cce1039c 100644
--- a/WWW/Library/Implementation/HTString.c
+++ b/WWW/Library/Implementation/HTString.c
@@ -697,16 +697,21 @@ PUBLIC_IF_FIND_LEAKS char * StrAllocVsprintf ARGS4(
 		case 'f':
 		    if (width < prec + NUM_WIDTH)
 			width = prec + NUM_WIDTH;
+		    /* FALLTHRU */
 		case 'i':
+		    /* FALLTHRU */
 		case 'p':
 		    if (width < prec + 2)
 			width = prec + 2; /* leading sign/space/zero, "0x" */
+		    break;
 		case 'c':
+		    break;
 		case '%':
 		    break;
 		default:
 		    if (width < prec)
 			width = prec;
+		    break;
 		}
 	    }
 	    if (width >= (int)tmp_len) {
diff --git a/WWW/Library/Implementation/HTTCP.c b/WWW/Library/Implementation/HTTCP.c
index 96cc2c2b..36c8ef2d 100644
--- a/WWW/Library/Implementation/HTTCP.c
+++ b/WWW/Library/Implementation/HTTCP.c
@@ -1470,7 +1470,7 @@ PUBLIC int HTDoConnect ARGS4(
     */
     memset(soc_in, 0, sizeof(*soc_in));
     soc_in->sin_family = AF_INET;
-    soc_in->sin_port = htons(default_port);
+    soc_in->sin_port = htons((unsigned short) default_port);
 
     /*
     **	Get node name and optional port number.
@@ -1977,7 +1977,6 @@ PUBLIC int BSDselect ARGS5(
     switch (rval) {
 	case -1:
 	    return(rval);
-	    break;
 
 	case 0:
 	    if (readfds != NULL)
@@ -1987,7 +1986,6 @@ PUBLIC int BSDselect ARGS5(
 	    if (exceptfds != NULL)
 		FD_ZERO(exceptfds);
 	    return(rval);
-	    break;
 
 	default:
 	    for (i = 0, rval = 0; i < nfds; i++) {
diff --git a/WWW/Library/Implementation/HTTCP.h b/WWW/Library/Implementation/HTTCP.h
index 589e16ef..8644b69d 100644
--- a/WWW/Library/Implementation/HTTCP.h
+++ b/WWW/Library/Implementation/HTTCP.h
@@ -18,9 +18,7 @@
 **           returns a pointer to a static string which must be copied if
 **                it is to be kept.
 */
-#ifndef _WINDOWS
 extern CONST char * HTInetString PARAMS((struct sockaddr_in* mysin));
-#endif
 
 
 /*      Encode INET status (as in sys/errno.h)                    inet_status()
diff --git a/WWW/Library/Implementation/HTTP.c b/WWW/Library/Implementation/HTTP.c
index 68797904..302fb7bf 100644
--- a/WWW/Library/Implementation/HTTP.c
+++ b/WWW/Library/Implementation/HTTP.c
@@ -792,8 +792,8 @@ try_again:
 
       StrAllocCat(command, anAnchor->post_data);
     }
-  else
-      StrAllocCat(command, crlf);	/* Blank line means "end" of headers */
+    else
+        StrAllocCat(command, crlf);	/* Blank line means "end" of headers */
 
   CTRACE((tfp, "Writing:\n%s%s----------------------------------\n",
 	       command,
diff --git a/WWW/Library/Implementation/HTTelnet.c b/WWW/Library/Implementation/HTTelnet.c
index 025ede23..4c16139f 100644
--- a/WWW/Library/Implementation/HTTelnet.c
+++ b/WWW/Library/Implementation/HTTelnet.c
@@ -154,7 +154,7 @@ PRIVATE int remote_session ARGS2(char *, acc_method, char *, host)
  *	NeXTSTEP is the implied version of the NeXT operating system.
  *		You may need to define this yourself.
  */
-#if	defined(NeXT) && defined(NeXTSTEP) && NeXTSTEP<=20100
+#if	!defined(TELNET_DONE) && (defined(NeXT) && defined(NeXTSTEP) && NeXTSTEP<=20100)
 #define FMT_TELNET "%s%s%s %s %s"
 
 	HTAddParam(&command, FMT_TELNET, 1, TELNET_PATH);
@@ -165,13 +165,11 @@ PRIVATE int remote_session ARGS2(char *, acc_method, char *, host)
 	HTEndParam(&command, FMT_TELNET, 5);
 
 	do_system(command);
-	return HT_NO_DATA;		/* Ok - it was done but no data */
 #define TELNET_DONE
 #endif
 
 /* Most unix machines support username only with rlogin */
-#if defined(UNIX) || defined(DOSPATH) || defined(__CYGWIN__)
-#ifndef TELNET_DONE
+#if !defined(TELNET_DONE) && (defined(UNIX) || defined(DOSPATH) || defined(__CYGWIN__))
 
 #define FMT_RLOGIN "%s %s%s%s"
 #define FMT_TN3270 "%s %s %s"
@@ -215,13 +213,12 @@ PRIVATE int remote_session ARGS2(char *, acc_method, char *, host)
        _eth_init();
 #endif /* WATT32 */
 #endif /* __DJGPP__ */
-	return HT_NO_DATA;		/* Ok - it was done but no data */
+
 #define TELNET_DONE
-#endif /* !TELNET_DONE */
 #endif /* unix */
 
 /* VMS varieties */
-#if defined(MULTINET)
+#if !defined(TELNET_DONE) && (defined(MULTINET))
 	if (login_protocol == rlogin) {
 	    HTSprintf0(&command, "RLOGIN%s%s%s%s%s %s",  /*lm 930713 */
 		user ? "/USERNAME=\"" : "",
@@ -245,66 +242,60 @@ PRIVATE int remote_session ARGS2(char *, acc_method, char *, host)
 	}
 
 	do_system(command);
-	return HT_NO_DATA;		/* Ok - it was done but no data */
 #define TELNET_DONE
 #endif /* MULTINET */
 
-#if defined(WIN_TCP)
-	{
-	    char *cp;
-
-	    if ((cp=getenv("WINTCP_COMMAND_STYLE")) != NULL &&
-		0==strncasecomp(cp, "VMS", 3)) { /* VMS command syntax */
-		if (login_protocol == rlogin) {
-		    HTSprintf0(&command, "RLOGIN%s%s%s%s%s %s",  /*lm 930713 */
-			user ? "/USERNAME=\"" : "",
-			user ? user : "",
-			user ? "\"" : "",
-			port ? "/PORT=" : "",
-			port ? port : "",
-			hostname);
-
-		} else if (login_protocol == tn3270) {
-		    HTSprintf0(&command, "TELNET/TN3270 %s%s %s",
-			port ? "/PORT=" : "",
-			port ? port : "",
-			hostname);
-
-		} else {  /* TELNET */
-		    HTSprintf0(&command, "TELNET %s%s %s",
-			port ? "/PORT=" : "",
-			port ? port : "",
-			hostname);
-		}
-
-	    } else { /* UNIX command syntax */
-	       if (login_protocol == rlogin) {
-		   HTSprintf0(&command, "RLOGIN %s%s%s%s%s",
-		       hostname,
-		       user ? " -l " : "",
-		       user ? "\"" : "",
-		       user ? user : "",
-		       user ? "\"" : "");
-
-		} else if (login_protocol == tn3270) {
-		    HTSprintf0(&command, "TN3270 %s %s",
-			hostname,
-			port ? port : "");
-
-		} else {  /* TELNET */
-		    HTSprintf0(&command, "TELNET %s %s",
-			hostname,
-			port ? port : "");
-		}
+#if !defined(TELNET_DONE) && defined(WIN_TCP)
+	if ((cp=getenv("WINTCP_COMMAND_STYLE")) != NULL &&
+	    0==strncasecomp(cp, "VMS", 3)) { /* VMS command syntax */
+	    if (login_protocol == rlogin) {
+		HTSprintf0(&command, "RLOGIN%s%s%s%s%s %s",  /*lm 930713 */
+		    user ? "/USERNAME=\"" : "",
+		    user ? user : "",
+		    user ? "\"" : "",
+		    port ? "/PORT=" : "",
+		    port ? port : "",
+		    hostname);
+
+	    } else if (login_protocol == tn3270) {
+		HTSprintf0(&command, "TELNET/TN3270 %s%s %s",
+		    port ? "/PORT=" : "",
+		    port ? port : "",
+		    hostname);
+
+	    } else {  /* TELNET */
+		HTSprintf0(&command, "TELNET %s%s %s",
+		    port ? "/PORT=" : "",
+		    port ? port : "",
+		    hostname);
 	    }
 
-	    do_system(command);
-	    return HT_NO_DATA;		/* Ok - it was done but no data */
+	} else { /* UNIX command syntax */
+	   if (login_protocol == rlogin) {
+	       HTSprintf0(&command, "RLOGIN %s%s%s%s%s",
+		   hostname,
+		   user ? " -l " : "",
+		   user ? "\"" : "",
+		   user ? user : "",
+		   user ? "\"" : "");
+
+	    } else if (login_protocol == tn3270) {
+		HTSprintf0(&command, "TN3270 %s %s",
+		    hostname,
+		    port ? port : "");
+
+	    } else {  /* TELNET */
+		HTSprintf0(&command, "TELNET %s %s",
+		    hostname,
+		    port ? port : "");
+	    }
 	}
+
+	do_system(command);
 #define TELNET_DONE
 #endif /* WIN_TCP */
 
-#ifdef UCX
+#if !defined(TELNET_DONE) && defined(UCX)
 	if (login_protocol == rlogin) {
 	    HTSprintf0(&command, "RLOGIN%s%s%s %s %s",
 		user ? "/USERNAME=\"" : "",
@@ -325,11 +316,10 @@ PRIVATE int remote_session ARGS2(char *, acc_method, char *, host)
 	}
 
 	do_system(command);
-	return HT_NO_DATA;		/* Ok - it was done but no data */
 #define TELNET_DONE
 #endif /* UCX */
 
-#ifdef CMU_TCP
+#if !defined(TELNET_DONE) && defined(CMU_TCP)
 	if (login_protocol == telnet) {
 	    HTSprintf0(&command, "TELNET %s%s %s",
 		port ? "/PORT=" : "",
@@ -347,14 +337,10 @@ PRIVATE int remote_session ARGS2(char *, acc_method, char *, host)
 	    LYgetch();
 	    HadVMSInterrupt = FALSE;
 	}
-	return HT_NO_DATA;		/* Ok - it was done but no data */
 #define TELNET_DONE
 #endif /* CMU_TCP */
 
-#ifdef SOCKETSHR_TCP
-  {
-    char *cp;
-
+#if !defined(TELNET_DONE) && defined(SOCKETSHR_TCP)
     if (getenv("MULTINET_SOCKET_LIBRARY") != NULL) {
 	if (login_protocol == rlogin) {
 	    HTSprintf0(&command, "MULTINET RLOGIN%s%s%s%s %s",  /*lm 930713 */
@@ -460,7 +446,6 @@ PRIVATE int remote_session ARGS2(char *, acc_method, char *, host)
 	    LYgetch();
 	    HadVMSInterrupt = FALSE;
 	}
-	return HT_NO_DATA;		/* Ok - it was done but no data */
     }
     else {
 	if (login_protocol == telnet) {
@@ -480,22 +465,18 @@ PRIVATE int remote_session ARGS2(char *, acc_method, char *, host)
 	    LYgetch();
 	    HadVMSInterrupt = FALSE;
 	}
-	return HT_NO_DATA;		/* Ok - it was done but no data */
     }
-  }
 #define TELNET_DONE
 #endif /* SOCKETSHR_TCP */
 
-#ifdef VM
-#define SIMPLE_TELNET
-#endif
-#ifdef SIMPLE_TELNET
+#if !defined(TELNET_DONE) && (defined(SIMPLE_TELNET) || defined(VM))
 	if (login_protocol == telnet) {			/* telnet only */
 	    HTSprintf0(&command, "TELNET  %s",	/* @@ Bug: port ignored */
 		hostname);
 	    do_system(command);
 	    return HT_NO_DATA;		/* Ok - it was done but no data */
 	}
+#define TELNET_DONE
 #endif
 
 #ifndef TELNET_DONE
@@ -520,8 +501,8 @@ PRIVATE int remote_session ARGS2(char *, acc_method, char *, host)
 	    }
 #endif /* VMS */
 	}
-	return HT_NO_DATA;
 #endif /* !TELNET_DONE */
+	return HT_NO_DATA;
 }
 
 /*	"Load a document" -- establishes a session
diff --git a/WWW/Library/Implementation/HTUU.c b/WWW/Library/Implementation/HTUU.c
index 5465f89f..76ce8117 100644
--- a/WWW/Library/Implementation/HTUU.c
+++ b/WWW/Library/Implementation/HTUU.c
@@ -187,18 +187,18 @@ PUBLIC int HTUU_decode ARGS3(char *,		bufcoded,
    bufin = bufcoded;
 
    while (nprbytes > 0) {
-      *(bufout++) = (unsigned char) (DEC(*bufin) << 2 | DEC(bufin[1]) >> 4);
-      *(bufout++) = (unsigned char) (DEC(bufin[1]) << 4 | DEC(bufin[2]) >> 2);
-      *(bufout++) = (unsigned char) (DEC(bufin[2]) << 6 | DEC(bufin[3]));
+      *(bufout++) = (unsigned char) ((DEC(*bufin) << 2) | (DEC(bufin[1]) >> 4));
+      *(bufout++) = (unsigned char) ((DEC(bufin[1]) << 4) | (DEC(bufin[2]) >> 2));
+      *(bufout++) = (unsigned char) ((DEC(bufin[2]) << 6) | (DEC(bufin[3])));
       bufin += 4;
       nprbytes -= 4;
    }
 
    if(nprbytes & 03) {
       if(pr2six[(int)bufin[-2]] > MAXVAL) {
-         nbytesdecoded -= 2;
+	 nbytesdecoded -= 2;
       } else {
-         nbytesdecoded -= 1;
+	 nbytesdecoded -= 1;
       }
    }
 
diff --git a/WWW/Library/Implementation/HTVMSUtils.c b/WWW/Library/Implementation/HTVMSUtils.c
index cc367a66..d3333e5c 100644
--- a/WWW/Library/Implementation/HTVMSUtils.c
+++ b/WWW/Library/Implementation/HTVMSUtils.c
@@ -32,8 +32,9 @@
 
 #include <LYUtils.h>
 #include <LYLeaks.h>
+#include <LYStrings.h>
 
-#define INFINITY 512            	/* File name length @@ FIXME */
+#define INFINITY 512			/* File name length @@ FIXME */
 
 PUBLIC BOOL HTVMSFileVersions=FALSE; /* Include version numbers in listing? */
 
@@ -104,7 +105,7 @@ unsigned long Prv[2], PreviousPrv[2];
 
    if (Result == SS$_NORMAL) {
        if (!(PreviousPrv[0] & PRV$M_SYSPRV)) {
-           CTRACE((tfp, "HTVMS_enableSysPrv: Enabled SYSPRV\n"));
+	   CTRACE((tfp, "HTVMS_enableSysPrv: Enabled SYSPRV\n"));
        }
    }
 }
@@ -130,7 +131,7 @@ unsigned long Prv[2], PreviousPrv[2];
 
    if (Result == SS$_NORMAL) {
        if (PreviousPrv[0] & PRV$M_SYSPRV) {
-           CTRACE((tfp, "HTVMS_disableSysPrv: Disabled SYSPRV\n"));
+	   CTRACE((tfp, "HTVMS_disableSysPrv: Disabled SYSPRV\n"));
        }
    }
 }
@@ -207,9 +208,9 @@ char *colon;
      Result = sys$check_access(&ObjType,&FileNameDesc,&UserNameDesc,ItemList);
 
      if (Result == SS$_NORMAL)
-        return(YES);
+	return(YES);
      else
-        return(NO);
+	return(NO);
    }
 
    return(NO);
@@ -223,22 +224,22 @@ char *colon;
 **	vmsname		VMS file specification (NO NODE)
 **
 ** ON EXIT:
-**	returns 	www file specification
+**	returns		www file specification
 **
 ** EXAMPLES:
 **	vmsname				wwwname
-**	DISK$USER 			disk$user
-**	DISK$USER: 			/disk$user/
-**	DISK$USER:[DUNS] 		/disk$user/duns
-**	DISK$USER:[DUNS.ECHO] 		/disk$user/duns/echo
-**	[DUNS] 				duns
-**	[DUNS.ECHO] 			duns/echo
-**	[DUNS.ECHO.-.TRANS] 		duns/echo/../trans
-**	[DUNS.ECHO.--.TRANS] 		duns/echo/../../trans
-**	[.DUNS] 			duns
-**	[.DUNS.ECHO] 			duns/echo
-**	[.DUNS.ECHO]TEST.COM 		duns/echo/test.com
-**	TEST.COM 			test.com
+**	DISK$USER			disk$user
+**	DISK$USER:			/disk$user/
+**	DISK$USER:[DUNS]		/disk$user/duns
+**	DISK$USER:[DUNS.ECHO]		/disk$user/duns/echo
+**	[DUNS]				duns
+**	[DUNS.ECHO]			duns/echo
+**	[DUNS.ECHO.-.TRANS]		duns/echo/../trans
+**	[DUNS.ECHO.--.TRANS]		duns/echo/../../trans
+**	[.DUNS]				duns
+**	[.DUNS.ECHO]			duns/echo
+**	[.DUNS.ECHO]TEST.COM		duns/echo/test.com
+**	TEST.COM			test.com
 **
 **
 */
@@ -246,7 +247,8 @@ PUBLIC char * HTVMS_wwwName ARGS1(
 	CONST char *,	vmsname)
 {
 static char wwwname[LY_MAXPATH];
-char *src, *dst;
+CONST char *src;
+char *dst;
 int dir;
    dst = wwwname;
    src = vmsname;
@@ -256,40 +258,40 @@ int dir;
    {
       switch(*src)
       {
-         case ':':  *(dst++) = '/'; break;
-         case '-': if (dir)
-	 	   {
-	 	      if ((*(src-1)=='[' || *(src-1)=='.' || *(src-1)=='-') &&
-		          (*(src+1)=='.' || *(src+1)=='-'))
+	 case ':':  *(dst++) = '/'; break;
+	 case '-': if (dir)
+		   {
+		      if ((*(src-1)=='[' || *(src-1)=='.' || *(src-1)=='-') &&
+			  (*(src+1)=='.' || *(src+1)=='-'))
 		      {
-		          *(dst++) = '/';
-                          *(dst++) = '.';
-                          *(dst++) = '.';
+			  *(dst++) = '/';
+			  *(dst++) = '.';
+			  *(dst++) = '.';
 		      }
 		      else
-		          *(dst++) = '-';
+			  *(dst++) = '-';
 		   }
 		   else
 		   {
 		      if (*(src-1) == ']') *(dst++) = '/';
 		      *(dst++) = '-';
 		   }
-                   break;
-         case '.': if (dir)
-                   {
-                      if (*(src-1) != '[') *(dst++) = '/';
-                   }
-                   else
+		   break;
+	 case '.': if (dir)
+		   {
+		      if (*(src-1) != '[') *(dst++) = '/';
+		   }
+		   else
 		   {
 		      if (*(src-1) == ']') *(dst++) = '/';
-                      *(dst++) = '.';
+		      *(dst++) = '.';
 		   }
-                   break;
-         case '[': dir = 1; break;
-         case ']': dir = 0; break;
-         default:  if (*(src-1) == ']') *(dst++) = '/';
-                   *(dst++) = *src;
-                   break;
+		   break;
+	 case '[': dir = 1; break;
+	 case ']': dir = 0; break;
+	 default:  if (*(src-1) == ']') *(dst++) = '/';
+		   *(dst++) = *src;
+		   break;
       }
    }
    *(dst++) = '\0';
@@ -304,7 +306,7 @@ int dir;
 **	fn		WWW file name
 **
 ** ON EXIT:
-**	returns 	vms file specification
+**	returns		vms file specification
 **
 ** Bug:	Returns pointer to static -- non-reentrant
 */
@@ -332,11 +334,11 @@ PUBLIC char * HTVMS_name ARGS2(
     strcpy(filename, fn);
     strcpy(nodename, "");	/* On same node?  Yes if node names match */
     if (strncmp(nn,"localhost",9)) {
-        char *p, *q;
-        for (p=hostname, q=(char *)nn;
+	char *p, *q;
+	for (p=hostname, q=(char *)nn;
 	     *p && *p!='.' && *q && *q!='.'; p++, q++){
 	    if (TOUPPER(*p)!=TOUPPER(*q)) {
-	        strcpy(nodename, nn);
+		strcpy(nodename, nn);
 		q = strchr(nodename, '.');	/* Mismatch */
 		if (q) *q=0;			/* Chop domain */
 		strcat(nodename, "::");		/* Try decnet anyway */
@@ -354,7 +356,7 @@ PUBLIC char * HTVMS_name ARGS2(
 	*second = 0;		/* Split filename from disk */
 	sprintf(vmsname, "%s%s:%s", nodename, filename+1, second+1);
 	*second = '/';	/* restore */
-    } else { 				/* More than two slashes */
+    } else {				/* More than two slashes */
 	char * p;
 	*second = 0;		/* Split disk from directories */
 	*last = 0;		/* Split dir from filename */
@@ -380,7 +382,7 @@ PUBLIC int HTStat ARGS2(
    /*
       the following stuff does not work in VMS with a normal stat...
       -->   /disk$user/duns/www if www is a directory
-		is statted like: 	/disk$user/duns/www.dir
+		is statted like:	/disk$user/duns/www.dir
 		after a normal stat has failed
       -->   /disk$user/duns	if duns is a toplevel directory
 		is statted like:	/disk$user/000000/duns.dir
@@ -452,11 +454,11 @@ char Name[256];
       Ptr2 = strchr(Ptr+1,'/');
       if ((Ptr2 == NULL) && (Name[0] == '/'))
       {
-         char End[256];
-         strcpy(End,Ptr);
-         *(Ptr+1) = '\0';
-         strcat(Name,"000000");
-         strcat(Name,End);
+	 char End[256];
+	 strcpy(End,Ptr);
+	 *(Ptr+1) = '\0';
+	 strcat(Name,"000000");
+	 strcat(Name,End);
       }
    }
 
@@ -487,7 +489,7 @@ typedef	struct __dirdesc {
 	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 */
+	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 */
 } DIR;
@@ -574,18 +576,18 @@ char *dot;
       char *openbr = strrchr(DirEntry,'[');
       if (!openbr)
       { /* convert disk$user: into disk$user:[000000]000000.dir */
-         strcpy(dir.dirname, DirEntry);
-         strcat(dir.dirname, "[000000]");
-         strcat(DirEntry,"[000000]000000.dir");
+	 strcpy(dir.dirname, DirEntry);
+	 strcat(dir.dirname, "[000000]");
+	 strcat(DirEntry,"[000000]000000.dir");
       }
       else
       {
-         char End[256];
-         strcpy(End,openbr+1);
-         *(openbr+1) = '\0';
-         strcat(DirEntry,"000000]");
-         strcat(DirEntry,End);
-         strcat(DirEntry,".dir");
+	 char End[256];
+	 strcpy(End,openbr+1);
+	 *(openbr+1) = '\0';
+	 strcat(DirEntry,"000000]");
+	 strcat(DirEntry,End);
+	 strcat(DirEntry,".dir");
       }
    }
    else
@@ -607,9 +609,9 @@ char *dot;
    entryname_desc.dsc$a_pointer = VMSentry;
 
    status = lib$find_file(&(dirname_desc),
-                          &entryname_desc,
-                          &(dir.context),
-                          0,0,0,0);
+			  &entryname_desc,
+			  &(dir.context),
+			  0,0,0,0);
    if (!(status & 0x01))
    { /* directory not found */
       return(NULL);
@@ -652,9 +654,9 @@ char *UnixEntry;
    entryname_desc.dsc$a_pointer = VMSentry;
 
    status = lib$find_file(&(dirp->dirname_desc),
-                          &entryname_desc,
-                          &(dirp->context),
-                          0,0,0,0);
+			  &entryname_desc,
+			  &(dirp->context),
+			  0,0,0,0);
    if (status == RMS$_NMF)
    { /* no more files */
       return(NULL);
@@ -663,11 +665,11 @@ char *UnixEntry;
    { /* ok */
       if (!(status & 0x01)) return(0);
       if (HTVMSFileVersions)
-          space = strchr(VMSentry,' ');
+	  space = strchr(VMSentry,' ');
       else
-          space = strchr(VMSentry,';');
+	  space = strchr(VMSentry,';');
       if (space)
-         *space = '\0';
+	 *space = '\0';
 
       /* convert to unix style... */
       UnixEntry = HTVMS_wwwName(VMSentry);
@@ -747,9 +749,9 @@ PUBLIC int compare_VMSEntryInfo_structs ARGS2(VMSEntryInfo *,entry1,
 
     switch(HTfileSortMethod)
       {
-        case FILE_BY_SIZE:
+	case FILE_BY_SIZE:
 			/* both equal or both 0 */
-                        if(entry1->size == entry2->size)
+			if(entry1->size == entry2->size)
 			    return(strcasecomp(entry1->filename,
 					       entry2->filename));
 			else
@@ -757,24 +759,22 @@ PUBLIC int compare_VMSEntryInfo_structs ARGS2(VMSEntryInfo *,entry1,
 				return(1);
 			    else
 				return(-1);
-                        break;
-        case FILE_BY_TYPE:
-                        if(entry1->type && entry2->type) {
-                            status = strcasecomp(entry1->type, entry2->type);
+	case FILE_BY_TYPE:
+			if(entry1->type && entry2->type) {
+			    status = strcasecomp(entry1->type, entry2->type);
 			    if(status)
 				return(status);
 			    /* else fall to filename comparison */
 			}
-                        return (strcasecomp(entry1->filename,
+			return (strcasecomp(entry1->filename,
 					    entry2->filename));
-                        break;
-        case FILE_BY_DATE:
-                        if(entry1->date && entry2->date) {
+	case FILE_BY_DATE:
+			if(entry1->date && entry2->date) {
 			    /*
 			    ** Make sure we have the correct length. - FM
 			    */
 			    if (strlen(entry1->date) != 12 ||
-			        strlen(entry2->date) != 12) {
+				strlen(entry2->date) != 12) {
 				return (strcasecomp(entry1->filename,
 						    entry2->filename));
 			    }
@@ -783,16 +783,16 @@ PUBLIC int compare_VMSEntryInfo_structs ARGS2(VMSEntryInfo *,entry1,
 			    ** chronological order. - FM
 			    */
 			    if (entry1->date[7] != ' ') {
-			        strcpy(date1, "9999");
+				strcpy(date1, "9999");
 				strcpy(time1, (char *)&entry1->date[7]);
 			    } else {
 				strcpy(date1, (char *)&entry1->date[8]);
-			        strcpy(time1, "00:00");
+				strcpy(time1, "00:00");
 			    }
 			    strncpy(month, entry1->date, 3);
 			    month[3] = '\0';
 			    for (i = 0; i < 12; i++) {
-			        if (!strcasecomp(month, months[i])) {
+				if (!strcasecomp(month, months[i])) {
 				    break;
 				}
 			    }
@@ -802,20 +802,20 @@ PUBLIC int compare_VMSEntryInfo_structs ARGS2(VMSEntryInfo *,entry1,
 			    strncat(date1, (char *)&entry1->date[4], 2);
 			    date1[8] = '\0';
 			    if (date1[6] == ' ') {
-			        date1[6] = '0';
+				date1[6] = '0';
 			    }
 			    strcat(date1, time1);
 			    if (entry2->date[7] != ' ') {
-			        strcpy(date2, "9999");
+				strcpy(date2, "9999");
 				strcpy(time2, (char *)&entry2->date[7]);
 			    } else {
 				strcpy(date2, (char *)&entry2->date[8]);
-			        strcpy(time2, "00:00");
+				strcpy(time2, "00:00");
 			    }
 			    strncpy(month, entry2->date, 3);
 			    month[3] = '\0';
 			    for (i = 0; i < 12; i++) {
-			        if (!strcasecomp(month, months[i])) {
+				if (!strcasecomp(month, months[i])) {
 				    break;
 				}
 			    }
@@ -825,29 +825,28 @@ PUBLIC int compare_VMSEntryInfo_structs ARGS2(VMSEntryInfo *,entry1,
 			    strncat(date2, (char *)&entry2->date[4], 2);
 			    date2[8] = '\0';
 			    if (date2[6] == ' ') {
-			        date2[6] = '0';
+				date2[6] = '0';
 			    }
 			    strcat(date2, time2);
 			    /*
 			    ** Do the comparison. - FM
 			    */
-                            status = strcasecomp(date2, date1);
+			    status = strcasecomp(date2, date1);
 			    if(status)
 				return(status);
 			    /* else fall to filename comparison */
 			}
-                        return (strcasecomp(entry1->filename,
+			return (strcasecomp(entry1->filename,
 					    entry2->filename));
-                        break;
-        case FILE_BY_NAME:
-        default:
-                        return (strcmp(entry1->filename,
+	case FILE_BY_NAME:
+	default:
+			return (strcmp(entry1->filename,
 					    entry2->filename));
       }
 }
 
 
-/*						    	HTVMSBrowseDir()
+/*							HTVMSBrowseDir()
 **
 **	This function generates a directory listing as an HTML-object
 **	for local file URL's.  It assumes the first two elements of
@@ -898,12 +897,12 @@ PUBLIC int HTVMSBrowseDir ARGS4(
      *  to /sys$sysroot/syshlp) before calling this routine.
      */
     if (((*pathname != '/') ||
-    	 (cp=strchr(pathname+1, '/')) == NULL ||
+	 (cp=strchr(pathname+1, '/')) == NULL ||
 	 *(cp+1) == '\0' ||
 	 0==strncmp((cp+1), "000000", 6)) ||
-        (dp=HTVMSopendir(pathname)) == NULL) {
-        FREE(pathname);
-    	return HTLoadError(sink, 403, COULD_NOT_ACCESS_DIR);
+	(dp=HTVMSopendir(pathname)) == NULL) {
+	FREE(pathname);
+	return HTLoadError(sink, 403, COULD_NOT_ACCESS_DIR);
     }
 
     /*
@@ -926,7 +925,7 @@ PUBLIC int HTVMSBrowseDir ARGS4(
     cp = strrchr(pathname, '/');  /* find lastslash */
     StrAllocCopy(tail, (cp+1)); /* take slash off the beginning */
     if (*tail != '\0') {
-        StrAllocCopy(title, tail);
+	StrAllocCopy(title, tail);
 	*cp = '\0';
 	if ((cp1=strrchr(pathname, '/')) != NULL &&
 	    cp1 != pathname &&
@@ -934,7 +933,7 @@ PUBLIC int HTVMSBrowseDir ARGS4(
 	    StrAllocCopy(parent, (cp1+1));
 	*cp = '/';
     } else {
-        pathname[strlen(pathname)-1] = '\0';
+	pathname[strlen(pathname)-1] = '\0';
 	cp = strrchr(pathname, '/');
 	StrAllocCopy(title, (cp+1));
 	pathname[strlen(pathname)] = '/';
@@ -974,19 +973,19 @@ PUBLIC int HTVMSBrowseDir ARGS4(
     END(HTML_H1);
     PUTC('\n');
     if (HTDirReadme == HT_DIR_README_TOP) {
-        FILE * fp;
+	FILE * fp;
 	if (header[strlen(header)-1] != '/')
 	    StrAllocCat(header, "/");
 	StrAllocCat(header, HT_DIR_README_FILE);
-        if ((fp = fopen(header,  "r")) != NULL) {
+	if ((fp = fopen(header,	 "r")) != NULL) {
 	    START(HTML_PRE);
 	    for(;;) {
-	        char c = fgetc(fp);
-	        if (c == (char)EOF)
+		char c = fgetc(fp);
+		if (c == (char)EOF)
 		    break;
 #ifdef NOTDEFINED
-	        switch (c) {
-	    	    case '&':
+		switch (c) {
+		    case '&':
 		    case '<':
 		    case '>':
 			PUTC('&');
@@ -997,14 +996,14 @@ PUBLIC int HTVMSBrowseDir ARGS4(
 			break;
 		    default:
 			PUTC(c);
-	        }
+		}
 #else
 		PUTC(c);
 #endif /* NOTDEFINED */
 	    }
 	    END(HTML_PRE);
 	    fclose(fp);
-        }
+	}
     }
     FREE(header);
     if (parent) {
@@ -1075,9 +1074,9 @@ PUBLIC int HTVMSBrowseDir ARGS4(
 	    if (HTStat(pathname, &file_info)) {
 		/* for VMS the failure here means the file is not readable...
 		   we however continue to browse through the directory... */
-                continue;
+		continue;
 	    }
-            entry_info = (VMSEntryInfo *)malloc(sizeof(VMSEntryInfo));
+	    entry_info = (VMSEntryInfo *)malloc(sizeof(VMSEntryInfo));
 	    if (entry_info == NULL)
 		outofmem(__FILE__, "HTVMSBrowseDir");
 	    entry_info->type = 0;
@@ -1103,45 +1102,45 @@ PUBLIC int HTVMSBrowseDir ARGS4(
 
 	    StrAllocCopy(entry_info->filename, dirbuf->d_name);
 	    if (S_ISDIR(file_info.st_mode)) {
-	        /* strip .DIR part... */
-                char *dot;
-                dot = strstr(entry_info->filename, ".DIR");
-                if (dot)
-                   *dot = '\0';
+		/* strip .DIR part... */
+		char *dot;
+		dot = strstr(entry_info->filename, ".DIR");
+		if (dot)
+		   *dot = '\0';
 		LYLowerCase(entry_info->filename);
 		StrAllocCopy(entry_info->type, "Directory");
 	    } else {
-	        if ((cp = strstr(entry_info->filename, "READ")) == NULL) {
-	            cp = entry_info->filename;
+		if ((cp = strstr(entry_info->filename, "READ")) == NULL) {
+		    cp = entry_info->filename;
 		} else {
 		    cp += 4;
 		    if (!strncmp(cp, "ME", 2)) {
-		        cp += 2;
+			cp += 2;
 			while (cp && *cp && *cp != '.') {
 			    cp++;
 			}
 		    } else if (!strncmp(cp, ".ME", 3)) {
-		        cp = (entry_info->filename +
+			cp = (entry_info->filename +
 			      strlen(entry_info->filename));
 		    } else {
-		        cp = entry_info->filename;
+			cp = entry_info->filename;
 		    }
 		}
 		LYLowerCase(cp);
 		if (((len = strlen(entry_info->filename)) > 2) &&
 		    entry_info->filename[len-1] == 'z') {
 		    if (entry_info->filename[len-2] == '.' ||
-		        entry_info->filename[len-2] == '_')
+			entry_info->filename[len-2] == '_')
 			entry_info->filename[len-1] = 'Z';
 		}
 	    }
 
 	    /* Get the date */
 	    {
-	        char *t = (char *)ctime((CONST time_t *)&file_info.st_ctime);
+		char *t = (char *)ctime((CONST time_t *)&file_info.st_ctime);
 		*(t+24) = '\0';
 
-	        StrAllocCopy(entry_info->date, (t+4));
+		StrAllocCopy(entry_info->date, (t+4));
 		*((entry_info->date)+7) = '\0';
 		if ((atoi((t+19))) < atoi(ThisYear))
 		    StrAllocCat(entry_info->date,  (t+19));
@@ -1153,16 +1152,16 @@ PUBLIC int HTVMSBrowseDir ARGS4(
 
 	    /* Get the size */
 	    if (!S_ISDIR(file_info.st_mode))
-	        entry_info->size = (unsigned int)file_info.st_size;
+		entry_info->size = (unsigned int)file_info.st_size;
 	    else
-	        entry_info->size = 0;
+		entry_info->size = 0;
 
 	    /* Now, update the BTree etc. */
 	    if(entry_info->display)
 	      {
 		 CTRACE((tfp,"Adding file to BTree: %s\n",
 						      entry_info->filename));
-	         HTBTree_add(bt, (VMSEntryInfo *)entry_info);
+		 HTBTree_add(bt, (VMSEntryInfo *)entry_info);
 	      }
 
 	} /* End while HTVMSreaddir() */
@@ -1186,8 +1185,8 @@ PUBLIC int HTVMSBrowseDir ARGS4(
 		/* Output the date */
 		if(entry_info->date)
 		       {
-		             PUTS(entry_info->date);
-		             PUTS("  ");
+			     PUTS(entry_info->date);
+			     PUTS("  ");
 		       }
 		else
 			PUTS("     * ");
@@ -1196,9 +1195,9 @@ PUBLIC int HTVMSBrowseDir ARGS4(
 		if(entry_info->type)
 		  {
 		    for(i = 0; entry_info->type[i] != '\0' && i < 15; i++)
-		        PUTC(entry_info->type[i]);
+			PUTC(entry_info->type[i]);
 		    for(; i < 17; i++)
-		        PUTC(' ');
+			PUTC(' ');
 
 		  }
 
@@ -1207,10 +1206,10 @@ PUBLIC int HTVMSBrowseDir ARGS4(
 		PUTS(entry_info->filename);
 		END(HTML_A);
 
-                /* Output the size */
+		/* Output the size */
 		if(entry_info->size)
 		  {
-		          if(entry_info->size < 1024)
+			  if(entry_info->size < 1024)
 			      sprintf(string_buffer,"  %d bytes",
 							entry_info->size);
 			  else
diff --git a/WWW/Library/Implementation/HTVMS_WaisProt.c b/WWW/Library/Implementation/HTVMS_WaisProt.c
index 76081407..9fddc10b 100644
--- a/WWW/Library/Implementation/HTVMS_WaisProt.c
+++ b/WWW/Library/Implementation/HTVMS_WaisProt.c
@@ -865,6 +865,7 @@ char* buffer;
 		  size -= (buf - originalBuf);
 		}
 	    }
+	    /* FALLTHRU */
 	  case DT_Source:
 	    buf = readString(&source,buf);
 	    break;
@@ -1204,6 +1205,7 @@ char* buffer;
 		  size -= (buf - originalBuf);
 		}
 	    }
+	    /* FALLTHRU */
 	  case DT_Source:
 	    buf = readString(&source,buf);
 	    break;
@@ -2193,7 +2195,7 @@ query_term** terms;
       docTerm = terms[termNum];
      
       if (docTerm == NULL)
-	break;			/* we're done converting */;
+	break;			/* we're done converting */
 
       typeTerm = terms[termNum + 1]; /* get the lead Term if it exists */
 
diff --git a/WWW/Library/Implementation/HTVMS_WaisUI.c b/WWW/Library/Implementation/HTVMS_WaisUI.c
index f5c5954e..2890841f 100644
--- a/WWW/Library/Implementation/HTVMS_WaisUI.c
+++ b/WWW/Library/Implementation/HTVMS_WaisUI.c
@@ -650,22 +650,22 @@ void* queryInfo)
   query->ReplaceIndicator = replace;
   query->ResultSetName = s_strdup(name);
   query->DatabaseNames = NULL;
-  if (databases != NULL)
-    { for (i = 0, ptr = databases[i]; ptr != NULL; ptr = databases[++i])
-	{ if (query->DatabaseNames == NULL)
+  if (databases != NULL) {
+    for (i = 0, ptr = databases[i]; ptr != NULL; ptr = databases[++i]) {
+	if (query->DatabaseNames == NULL)
 	    query->DatabaseNames = (char**)s_malloc((size_t)(sizeof(char*) * 2));
         else
           query->DatabaseNames = (char**)s_realloc((char*)query->DatabaseNames,
 						   (size_t)(sizeof(char*) * (i + 2)));
 	    query->DatabaseNames[i] = s_strdup(ptr);
 	    query->DatabaseNames[i+1] = NULL;
-	  }
-      }
+	}
+    }
   query->QueryType = s_strdup(type);
   query->ElementSetNames = NULL;
-  if (elements != NULL)
-    { for (i = 0, ptr = elements[i]; ptr != NULL; ptr = elements[++i])
-	{ if (query->ElementSetNames == NULL)
+  if (elements != NULL) {
+    for (i = 0, ptr = elements[i]; ptr != NULL; ptr = elements[++i]) {
+	if (query->ElementSetNames == NULL)
 	    query->ElementSetNames = (char**)s_malloc((size_t)(sizeof(char*) * 2));
         else
           query->ElementSetNames = (char**)s_realloc((char*)query->ElementSetNames,
@@ -717,9 +717,9 @@ writeSearchAPDU(SearchAPDU* query, char* buffer, long* len)
   buf = writeBoolean(query->ReplaceIndicator,buf,len);
   buf = writeString(query->ResultSetName,DT_ResultSetName,buf,len);
   /* write database names */
-  if (query->DatabaseNames != NULL)
-    { for (i = 0,scratch = NULL, ptr = query->DatabaseNames[i]; ptr != NULL; ptr = query->DatabaseNames[++i])
-	{ if (scratch == NULL)
+  if (query->DatabaseNames != NULL) {
+    for (i = 0,scratch = NULL, ptr = query->DatabaseNames[i]; ptr != NULL; ptr = query->DatabaseNames[++i]) {
+	if (scratch == NULL)
 	    scratch = s_strdup(ptr);
         else
 	  { size_t newScratchSize = (size_t)(strlen(scratch) + strlen(ptr) + 2);
@@ -727,16 +727,16 @@ writeSearchAPDU(SearchAPDU* query, char* buffer, long* len)
 	    s_strncat(scratch,DB_DELIMITER,2,newScratchSize);
 	    s_strncat(scratch,ptr,strlen(ptr) + 1,newScratchSize);
 	  }
-	  }
+	}
 	buf = writeString(scratch,DT_DatabaseNames,buf,len);
 	s_free(scratch);
       }
   buf = writeString(query->QueryType,DT_QueryType,buf,len);
   /* write element set names */
-  if (query->ElementSetNames != NULL)
-    { for (i = 0,scratch = NULL, ptr = query->ElementSetNames[i]; ptr != NULL; ptr = query->ElementSetNames[++i])
-	{ if (scratch == NULL)
-	    { if (query->ElementSetNames[i+1] == NULL) /* there is a single element set name */
+  if (query->ElementSetNames != NULL) {
+    for (i = 0,scratch = NULL, ptr = query->ElementSetNames[i]; ptr != NULL; ptr = query->ElementSetNames[++i]) {
+	if (scratch == NULL) {
+	    if (query->ElementSetNames[i+1] == NULL) /* there is a single element set name */
 		{ scratch = (char*)s_malloc((size_t)strlen(ptr) + 2);
 		  strncpy(scratch,ES_DELIMITER_1,2);
 		  s_strncat(scratch,ptr,strlen(ptr) + 1,strlen(ptr) + 2);
@@ -749,7 +749,7 @@ writeSearchAPDU(SearchAPDU* query, char* buffer, long* len)
 		s_strncat(scratch,ES_DELIMITER_1,2,newScratchSize);
 		s_strncat(scratch,ptr,strlen(ptr) + 1,newScratchSize);
 	      }
-	      }
+	  }
         else
 	  { char* esPtr = query->ElementSetNames[++i]; /* the element set name */
 	    size_t newScratchSize = (size_t)(strlen(scratch) + strlen(ptr) + strlen(esPtr) + 3);
@@ -953,11 +953,11 @@ makeDiag(boolean surrogate, char* code, char* addInfo)
 void
 freeDiag(diagnosticRecord* diag)
 {
-  if (diag != NULL)
-    { if (diag->ADDINFO != NULL)
+  if (diag != NULL) {
+    if (diag->ADDINFO != NULL)
 	s_free(diag->ADDINFO);
-	s_free(diag);
-      }
+    s_free(diag);
+  }
 }
 
 /*----------------------------------------------------------------------*/
@@ -2032,10 +2032,10 @@ readQuery(any *info)
   query_term** terms = NULL;
   query_term* qt = NULL;
   long numTerms = 0L;
-char tmp[100];
+  char tmp[100];
 
-sprintf(tmp,"readquery: bytes: %ld",info->size);
-log_write(tmp);
+  sprintf(tmp,"readquery: bytes: %ld",info->size);
+  log_write(tmp);
 
   while (readPos < info->bytes + info->size)
     { readPos = readQueryTerm(&qt,readPos);
@@ -2048,7 +2048,7 @@ log_write(tmp);
 	    (query_term**)s_realloc((char*)terms,
 				    (size_t)(sizeof(query_term*)*(numTerms+2)));
 	  }
-if(qt==NULL)
+      if (qt == NULL)
 	log_write("qt = null");
       terms[numTerms++] = qt;
       terms[numTerms] = NULL;
diff --git a/WWW/Library/Implementation/HTWAIS.c b/WWW/Library/Implementation/HTWAIS.c
index 52e613e7..92a8b3b0 100644
--- a/WWW/Library/Implementation/HTWAIS.c
+++ b/WWW/Library/Implementation/HTWAIS.c
@@ -75,6 +75,7 @@
 /*			FROM WWW
 **			--------
 */
+#include <LYUtils.h>
 #include <LYLeaks.h>
 
 #define DIRECTORY "/cnidr.org:210/directory-of-servers"
@@ -663,7 +664,7 @@ PUBLIC int HTLoadWAIS ARGS4(
     }
     if (names[0] == '/') {
 	server_name = names+1;
-	if (as_gate =(*server_name == '/'))
+	if ((as_gate =(*server_name == '/')) != 0)
 	    server_name++;	/* Accept one or two */
 	www_database = strchr(server_name,'/');
 	if (www_database) {
@@ -816,7 +817,8 @@ PUBLIC int HTLoadWAIS ARGS4(
 	HTStructured * target;
 
 	strncpy(keywords, key, MAX_KEYWORDS_LENGTH);
-	while(p=strchr(keywords, '+')) *p = ' ';
+	while ((p = strchr(keywords, '+')) != 0)
+	    *p = ' ';
 
 	/*
 	**  Send advance title to get something fast to the other end.
diff --git a/WWW/Library/Implementation/SGML.c b/WWW/Library/Implementation/SGML.c
index 03db38da..db7e9e40 100644
--- a/WWW/Library/Implementation/SGML.c
+++ b/WWW/Library/Implementation/SGML.c
@@ -39,9 +39,11 @@
 # 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)
 
@@ -157,6 +159,7 @@ struct _HTStream {
 		S_esc_dq, S_dollar_dq, S_paren_dq, S_nonascii_text_dq,
 		S_dollar_paren_dq,
 		S_in_kanji, S_junk_tag, S_junk_pi} state;
+    unsigned char kanji_buf;
 #ifdef CALLERDATA
     void *			callerData;
 #endif /* CALLERDATA */
@@ -1473,7 +1476,7 @@ PRIVATE void SGML_character ARGS2(
     **	we can revert back to the unchanged c_in. - KW
     */
 #define unsign_c clong
-#ifdef CJK_EX	/* 1997/12/12 (Fri) 18:08:48 */
+#if 0
     static unsigned char sjis_1st = '\0';
     unsigned char sjis_hi, sjis_lo;
 #endif
@@ -1690,6 +1693,9 @@ 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))) {
@@ -1708,6 +1714,7 @@ top1:
 	}
     }
 #endif
+#endif
 
     /*
     **	Ignore 127 if we don't have HTPassHighCtrlRaw
@@ -1727,6 +1734,24 @@ top1:
 	!(PASSHICTRL || HTCJK != NOCJK))
 	goto after_switch;
 
+    /* Almost all CJK characters are double byte but only Japanese
+     * JIS X0201 Kana is single byte. To prevent to fail SGML parsing
+     * we have to care them here. -- TH
+     */
+    if ((HTCJK==JAPANESE) && (context->state==S_in_kanji) &&
+	!IS_JAPANESE_2BYTE(context->kanji_buf,(unsigned char)c)) {
+#ifdef CONV_JISX0201KANA_TO_JISX0208KANA
+	if (IS_SJIS_X0201KANA(context->kanji_buf)) {
+	    JISx0201TO0208_SJIS(context->kanji_buf, &sjis_hi, &sjis_lo);
+	    PUTC(sjis_hi);
+	    PUTC(sjis_lo);
+	}
+	else
+#endif
+	    PUTC(context->kanji_buf);
+	context->state = S_text;
+    }
+
     /*
     **	Handle character based on context->state.
     */
@@ -1744,6 +1769,7 @@ top1:
 	**  (see below). - FM
 	*/
 	context->state = S_text;
+	PUTC(context->kanji_buf);
 	PUTC(c);
 	break;
 
@@ -1772,7 +1798,7 @@ top1:
 	    **	to having raw mode off with CJK. - FM
 	    */
 	    context->state = S_in_kanji;
-	    PUTC(c);
+	    context->kanji_buf = c;
 	    break;
 	} else if (HTCJK != NOCJK && TOASCII(c) == '\033') {  /* S/390 -- gil -- 0881 */
 	    /*
@@ -3514,7 +3540,7 @@ top1:
 		PSRCSTART(abracket);
 		PUTC('>');
 		PSRCSTOP(abracket);
-	} else
+	    } else
 #endif
 	    if (context->current_tag->name)
 		start_element(context);
@@ -4097,6 +4123,8 @@ top1:
 	    context->state = S_esc;
 	}
 	PUTC(c);
+	if (c < 32)
+	    context->state = S_text;
 	break;
 
     case S_esc_sq:	/* Expecting '$'or '(' following CJK ESC. */
@@ -4383,6 +4411,7 @@ PUBLIC HTStream* SGML_new  ARGS3(
 /*    context->extra_tags = dtd->tags + dtd->number_of_tags; */
     context->current_tag = context->slashedtag = NULL;
     context->state = S_text;
+    context->kanji_buf = '\0';
     context->element_stack = 0;			/* empty */
     context->inSELECT = FALSE;
     context->no_lynx_specialcodes = NO;	/* special codes normally generated */
diff --git a/WWW/Library/Implementation/crypt_util.c b/WWW/Library/Implementation/crypt_util.c
index 7f341a4d..8680464a 100644
--- a/WWW/Library/Implementation/crypt_util.c
+++ b/WWW/Library/Implementation/crypt_util.c
@@ -278,7 +278,7 @@ static ufc_long longmask[32] = {
 
 #ifdef DEBUG
 
-pr_bits ARGS2(
+void pr_bits ARGS2(
 	ufc_long *,	a,
 	int,		n)
 {
@@ -295,7 +295,7 @@ pr_bits ARGS2(
     printf(" ");
 }
 
-static set_bits ARGS2(
+static void set_bits ARGS2(
 	ufc_long,	v,
 	ufc_long *,	b)
 {
@@ -949,7 +949,7 @@ void ufc_setup_password(cookie, s)
 
     setup_salt(s);
     dl1 = dl2 = dr1 = dr2 = 0;
-    for(i = 0, s += 2; c = *s++; i++) {
+    for(i = 0, s += 2; (c = *s++) != 0; i++) {
       int x = ascii_to_bin(c);
       dl1 |= revfinal[i][x][0];
       dl2 |= revfinal[i][x][1];
diff --git a/WWW/Library/djgpp/makefile b/WWW/Library/djgpp/makefile
index d5c46331..78567d28 100644
--- a/WWW/Library/djgpp/makefile
+++ b/WWW/Library/djgpp/makefile
@@ -14,8 +14,8 @@ WWW_MACH = djgpp
  -DLINKEDSTYLES
 
 
-CFLAGS = -O2 -DUSE_ZLIB -DDOSPATH -DNOUSERS -DDISP_PARTIAL \
--DDIRED_SUPPORT -DSOURCE_CACHE -DUSE_PSRC \
+CFLAGS = -O1 -DUSE_ZLIB -DDOSPATH -DNOUSERS -DDISP_PARTIAL \
+-DDIRED_SUPPORT -DSOURCE_CACHE -DUSE_PRETTYSRC \
  $(ENABLE_COLOR_STYLE) \
 -DEXP_FILE_UPLOAD \
 -DWATT32 \
diff --git a/WWW/Library/djgpp/makefile.sla b/WWW/Library/djgpp/makefile.sla
index bc9439e1..540f9a33 100644
--- a/WWW/Library/djgpp/makefile.sla
+++ b/WWW/Library/djgpp/makefile.sla
@@ -7,8 +7,8 @@ WWW_MACH = djgpp
 # The ASIS repository's name for the machine we are on
 #ASIS_MACH = hardware/os
 
-CFLAGS = -O3 -DUSE_SLANG -DUSE_ZLIB -DDOSPATH -DNOUSERS -DDISP_PARTIAL \
--DDIRED_SUPPORT -DSOURCE_CACHE -DUSE_PSRC \
+CFLAGS = -O1 -DUSE_SLANG -DUSE_ZLIB -DDOSPATH -DNOUSERS -DDISP_PARTIAL \
+-DDIRED_SUPPORT -DSOURCE_CACHE -DUSE_PRETTYSRC \
 -DWATT32 \
 -I../Implementation \
 -I../../../djgpp/watt32/inc -I../../../djgpp/watt32/inc/sys \