about summary refs log tree commit diff stats
path: root/WWW/Library
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2002-01-02 01:55:54 -0500
committerThomas E. Dickey <dickey@invisible-island.net>2002-01-02 01:55:54 -0500
commitd83d4af153de5a3cfacc4ce014183fd36e0cd920 (patch)
tree9e662d0b0ea4548c781e16e0159c0146f9dd3105 /WWW/Library
parent90d33dc9d0323ee3faf8477fcbddb376a6fcdb9a (diff)
downloadlynx-snapshots-d83d4af153de5a3cfacc4ce014183fd36e0cd920.tar.gz
snapshot of project "lynx", label v2-8-5dev_6
Diffstat (limited to 'WWW/Library')
-rw-r--r--WWW/Library/Implementation/HTDOS.c32
-rw-r--r--WWW/Library/Implementation/HTFile.c27
-rw-r--r--WWW/Library/Implementation/HTMLDTD.c3
-rw-r--r--WWW/Library/Implementation/HTTP.c9
-rw-r--r--WWW/Library/Implementation/HTUtils.h20
5 files changed, 67 insertions, 24 deletions
diff --git a/WWW/Library/Implementation/HTDOS.c b/WWW/Library/Implementation/HTDOS.c
index 0d943a25..47f31283 100644
--- a/WWW/Library/Implementation/HTDOS.c
+++ b/WWW/Library/Implementation/HTDOS.c
@@ -4,10 +4,7 @@
 
 #include <HTUtils.h>
 #include <HTDOS.h>
-
-#ifdef WIN_EX
-#include <LYGlobalDefs.h>
-#endif
+#include <LYStrings.h>
 
 /*
  * Make a copy of the source argument in the result, allowing some extra
@@ -71,14 +68,6 @@ char * HTDOS_wwwName ARGS1(CONST char *, dosname)
 	cp_url++;
 	*cp_url = '\0';
     }
-
-#ifdef NOTUSED
-    if(*cp_url == ':') {
-	cp_url++;
-	*cp_url = '/';	/* terminate drive letter to survive */
-    }
-#endif
-
     return(wwwname);
 }
 
@@ -151,6 +140,25 @@ char * HTDOS_name ARGS1(char *, wwwname)
     return (result);
 }
 
+#ifdef WIN_EX
+PUBLIC char *HTDOS_short_name(char *path)
+{
+    static char sbuf[LY_MAXPATH];
+    char *ret;
+    DWORD r;
+
+    if (strchr(path, '/'))
+	path = HTDOS_name(path);
+    r = GetShortPathName(path, sbuf, sizeof sbuf);
+    if (r >= sizeof(sbuf) || r == 0) {
+	ret = LYstrncpy(sbuf, path, sizeof(sbuf));
+    } else {
+	ret = sbuf;
+    }
+    return ret;
+}
+#endif
+
 #if defined(DJGPP) && defined(DJGPP_KEYHANDLER)
 /* PUBLIC       getxkey()
 **              Replaces libc's getxkey() with polling of tcp/ip
diff --git a/WWW/Library/Implementation/HTFile.c b/WWW/Library/Implementation/HTFile.c
index 4ca9a6f1..9ddfd398 100644
--- a/WWW/Library/Implementation/HTFile.c
+++ b/WWW/Library/Implementation/HTFile.c
@@ -340,6 +340,7 @@ PRIVATE void LYListFmtParse ARGS5(
 		case 'K':	/* size in Kilobytes but not for directories */
 			if (S_ISDIR(data->file_info.st_mode)) {
 				FormatStr(&buf, start, "");
+				StrAllocCat(buf, " ");
 				break;
 			}
 			/* FALL THROUGH */
@@ -1318,16 +1319,15 @@ PUBLIC void HTDirEntry ARGS3(
 	CONST char *,	entry)
 {
     char * relative = NULL;
+    char * stripped = NULL;
     char * escaped = NULL;
     int len;
 
-    if (0 == strcmp(entry,"../")) {
-	/*
-	**  Undo slash appending for anchor creation.
-	*/
-	StrAllocCopy(escaped,"..");
-    } else {
-	escaped = HTEscape(entry, URL_XPALPHAS);
+    StrAllocCopy(escaped, entry);
+    LYTrimPathSep(escaped);
+    if (strcmp(escaped, "..") != 0) {
+	stripped = escaped;
+	escaped = HTEscape(stripped, URL_XPALPHAS);
 	if (((len = strlen(escaped)) > 2) &&
 	    escaped[(len - 3)] == '%' &&
 	    escaped[(len - 2)] == '2' &&
@@ -1353,6 +1353,7 @@ PUBLIC void HTDirEntry ARGS3(
 	HTStartAnchor(target, NULL, relative);
 	FREE(relative);
     }
+    FREE(stripped);
     FREE(escaped);
 }
 
@@ -1632,7 +1633,10 @@ PRIVATE void do_readme ARGS2(HTStructured *, target, CONST char *, localname)
 
 PRIVATE char *file_type ARGS1(char *, path)
 {
-    char *type = strchr(path, '.');
+    char *type;
+    while (*path == '.')
+	++path;
+    type = strchr(path, '.');
     if (type == NULL)
 	type = "";
     return type;
@@ -1672,6 +1676,13 @@ PRIVATE int dired_cmp ARGS2(void *, a, void *, b)
 #endif /* LONG_LIST */
     if (code == 0)
 	code = AS_cmp(p->file_name, q->file_name);
+#if 0
+    CTRACE((tfp, "dired_cmp(%d) ->%d\n\t%c:%s (%s)\n\t%c:%s (%s)\n",
+	    dir_list_order,
+	    code,
+	    p->sort_tags, p->file_name, file_type(p->file_name),
+	    q->sort_tags, q->file_name, file_type(q->file_name)));
+#endif
     return code;
 }
 
diff --git a/WWW/Library/Implementation/HTMLDTD.c b/WWW/Library/Implementation/HTMLDTD.c
index 09d39023..ec8aa5e3 100644
--- a/WWW/Library/Implementation/HTMLDTD.c
+++ b/WWW/Library/Implementation/HTMLDTD.c
@@ -1663,7 +1663,8 @@ PUBLIC void HTSwitchDTD ARGS1(
     int,		new_flag)
 {
     if (TRACE)
-	CTRACE((tfp,"HTMLDTD: Copying DTD element info of size %d, %d * %d\n",
+	CTRACE((tfp,"HTMLDTD: Copying %s DTD element info of size %d, %d * %d\n",
+		new_flag ? "strict" : "tagsoup",
 		(int) (new_flag ? sizeof(tags_new) : sizeof(tags_old)),
 		HTML_ALL_ELEMENTS,
 		(int) sizeof(HTTag)));
diff --git a/WWW/Library/Implementation/HTTP.c b/WWW/Library/Implementation/HTTP.c
index 3562801e..7dcd0d9f 100644
--- a/WWW/Library/Implementation/HTTP.c
+++ b/WWW/Library/Implementation/HTTP.c
@@ -685,9 +685,12 @@ use_tunnel:
        * adding the base URL but is simpler than augmenting the dump's
        * presentation logic -TD
        */
-      if (!LYPrependBaseToSource)
+      if (LYPrependBaseToSource && dump_output_immediately) {
+	  CTRACE((tfp, "omit Accept-Encoding to work-around interaction with -source\n"));
+      } else {
 	  HTSprintf(&command, "Accept-Encoding: %s, %s%c%c",
 		    "gzip", "compress", CR, LF);
+      }
 
       if (language && *language) {
 	  HTSprintf(&command, "Accept-Language: %s%c%c", language, CR, LF);
@@ -876,7 +879,7 @@ use_tunnel:
 	    **	document being proxied.
 	    */
 	    if (!strncmp(docname, "http", 4)) {
-		cookie = LYCookie(host2, path2, port2, secure);
+		cookie = LYAddCookieHeader(host2, path2, port2, secure);
 	    }
 	    FREE(host2);
 	    FREE(path2);
@@ -888,7 +891,7 @@ use_tunnel:
 	    /*
 	    **	Add cookie for a non-proxied request. - FM
 	    */
-	    cookie = LYCookie(hostname, abspath, portnumber, secure);
+	    cookie = LYAddCookieHeader(hostname, abspath, portnumber, secure);
 	    auth_proxy = NO;
 	}
 	/*
diff --git a/WWW/Library/Implementation/HTUtils.h b/WWW/Library/Implementation/HTUtils.h
index b006913a..95e15456 100644
--- a/WWW/Library/Implementation/HTUtils.h
+++ b/WWW/Library/Implementation/HTUtils.h
@@ -590,6 +590,26 @@ extern char HTGetSSLCharacter PARAMS((void * handle));
 
 #endif /* USE_SSL */
 
+#if HAVE_LIBDMALLOC
+#include <dmalloc.h>    /* Gray Watson's library */
+#define show_alloc() dmalloc_log_unfreed()
+#else
+#undef  HAVE_LIBDMALLOC
+#define HAVE_LIBDMALLOC 0
+#endif
+
+#if HAVE_LIBDBMALLOC
+#include <dbmalloc.h>   /* Conor Cahill's library */
+#define show_alloc() malloc_dump(fileno(stderr))
+#else
+#undef  HAVE_LIBDBMALLOC
+#define HAVE_LIBDBMALLOC 0
+#endif
+
+#ifndef show_alloc
+#define show_alloc()	/* nothing */
+#endif
+
 #include <userdefs.h>
 
 #endif /* HTUTILS_H */