about summary refs log tree commit diff stats
path: root/WWW
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>1997-09-06 22:48:00 -0400
committerThomas E. Dickey <dickey@invisible-island.net>1997-09-06 22:48:00 -0400
commit549ec595d1da7693d5f7730e63f539cc8452307f (patch)
tree0ab3576fd5bbbcf610cc58e24f1762d4da3ac7f7 /WWW
parent73d5512d62200a263f3084bd869366326e445cf4 (diff)
downloadlynx-snapshots-549ec595d1da7693d5f7730e63f539cc8452307f.tar.gz
snapshot of project "lynx", label v2-7-1ac_0-60
Diffstat (limited to 'WWW')
-rw-r--r--WWW/Library/Implementation/HTFile.c35
-rw-r--r--WWW/Library/Implementation/HTMIME.c2
2 files changed, 25 insertions, 12 deletions
diff --git a/WWW/Library/Implementation/HTFile.c b/WWW/Library/Implementation/HTFile.c
index 4d21093a..9e9a31a6 100644
--- a/WWW/Library/Implementation/HTFile.c
+++ b/WWW/Library/Implementation/HTFile.c
@@ -1687,6 +1687,7 @@ PUBLIC int HTLoadFile ARGS4(
 	    (0 == strcmp(localname + strlen(localname) - strlen(MULTI_SUFFIX),
 	                 MULTI_SUFFIX))) {
 	    DIR *dp;
+	    BOOL forget_multi = NO;
 
 	    STRUCT_DIRENT * dirbuf;
 	    float best = NO_VALUE_FOUND;	/* So far best is bad */
@@ -1696,15 +1697,16 @@ PUBLIC int HTLoadFile ARGS4(
 	    char *base = strrchr(localname, '/');
 	    int baselen;
 
-	    if (!base || base == localname)
-	        goto forget_multi;
-	    *base++ = '\0';		/* Just got directory name */
-	    baselen = strlen(base)- strlen(MULTI_SUFFIX);
-	    base[baselen] = '\0';	/* Chop off suffix */
+	    if (!base || base == localname) {
+	        forget_multi = YES;
+	    } else {
+		*base++ = '\0';		/* Just got directory name */
+		baselen = strlen(base)- strlen(MULTI_SUFFIX);
+		base[baselen] = '\0';	/* Chop off suffix */
 
-	    dp = opendir(localname);
-	    if (!dp) {
-forget_multi:
+		dp = opendir(localname);
+	    }
+	    if (forget_multi || !dp) {
 		FREE(localname);
 		FREE(nodename);
 		return HTLoadError(sink, 500,
@@ -1894,7 +1896,16 @@ forget_multi:
         	    StrAllocCopy (tail, "/foo/..");
     	    	else {
         	    char *p = strrchr(pathname, '/');  /* find lastslash */
-        	    StrAllocCopy(tail, p+1); /* take slash off the beginning */
+		    if (!p) {
+			/*
+			 *  This probably should not happen, but be
+			 *  prepared if it does... - kw
+			 */
+			StrAllocCopy (tail, "/foo/..");
+		    } else {
+			/* take slash off the beginning */
+			StrAllocCopy(tail, p+1);
+		    }
     		}
     		FREE(pathname);
 
@@ -1926,8 +1937,10 @@ forget_multi:
 					       (HTAnchor *)anchor, FALSE);
 
 #ifdef DIRED_SUPPORT
-		HTAnchor_setFormat((HTParentAnchor *) anchor, WWW_DIRED);
-		lynx_edit_mode = TRUE;
+		if (strncmp(anchor->address, "lynxcgi:", 8)) {
+		    HTAnchor_setFormat((HTParentAnchor *) anchor, WWW_DIRED);
+		    lynx_edit_mode = TRUE;
+		}
 #endif /* DIRED_SUPPORT */
                 if (HTDirReadme == HT_DIR_README_TOP)
 		    do_readme(target, localname);
diff --git a/WWW/Library/Implementation/HTMIME.c b/WWW/Library/Implementation/HTMIME.c
index 60645dee..3b887b8c 100644
--- a/WWW/Library/Implementation/HTMIME.c
+++ b/WWW/Library/Implementation/HTMIME.c
@@ -2036,7 +2036,7 @@ PRIVATE void HTMIME_write ARGS3(
 
     } else {
         if (TRACE)
-	    fprintf(stderr, "HTMIME:  %s\n", s);
+	    fprintf(stderr, "HTMIME:  %.*s\n", l, s);
 
         for (p = s; p < s+l; p++)
 	    HTMIME_put_character(me, *p);