aboutsummaryrefslogtreecommitdiffstats
path: root/WWW/Library/Implementation
diff options
context:
space:
mode:
Diffstat (limited to 'WWW/Library/Implementation')
-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);