about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--CHANGES8
-rw-r--r--WWW/Library/Implementation/HTAnchor.c18
-rw-r--r--WWW/Library/Implementation/HTAnchor.h4
-rw-r--r--src/LYList.c17
4 files changed, 38 insertions, 9 deletions
diff --git a/CHANGES b/CHANGES
index 8812595f..0083ef00 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,9 +1,15 @@
--- $LynxId: CHANGES,v 1.664 2013/10/02 22:21:18 tom Exp $
+-- $LynxId: CHANGES,v 1.665 2013/10/02 23:30:51 tom Exp $
 ===============================================================================
 Changes since Lynx 2.8 release
 ===============================================================================
 
 2013-10-02 (2.8.8dev.17)
+* simplify file-URLs shown in reference list of -dump by trimming unnecessary
+  "localhost", e.g.,
+    file://localhost/XXX
+  becomes
+    file:///XXX
+  (Debian #334787) -TD
 * extend the "Bad HTML" warning feature to -dump option when the -stderr
   option is also set (Debian #398304) -TD
 * add -list_inline option, which modifies -dump output to put links inline with
diff --git a/WWW/Library/Implementation/HTAnchor.c b/WWW/Library/Implementation/HTAnchor.c
index 441a55e5..1b160691 100644
--- a/WWW/Library/Implementation/HTAnchor.c
+++ b/WWW/Library/Implementation/HTAnchor.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: HTAnchor.c,v 1.74 2013/05/05 19:25:16 tom Exp $
+ * $LynxId: HTAnchor.c,v 1.75 2013/10/02 23:24:34 tom Exp $
  *
  *	Hypertext "Anchor" Object				HTAnchor.c
  *	==========================
@@ -883,6 +883,22 @@ char *HTAnchor_address(HTAnchor * me)
     return (addr);
 }
 
+char *HTAnchor_short_address(HTAnchor * me)
+{
+    const char chop[] = "file://localhost/";
+    char *addr = HTAnchor_address(me);
+
+    if (!strncmp(addr, chop, sizeof(chop) - 1)) {
+	char *a = addr + 7;
+	char *b = addr + sizeof(chop) - 2;
+
+	while ((*a++ = *b++) != '\0') {
+	    ;
+	}
+    }
+    return addr;
+}
+
 void HTAnchor_setFormat(HTParentAnchor *me,
 			HTFormat form)
 {
diff --git a/WWW/Library/Implementation/HTAnchor.h b/WWW/Library/Implementation/HTAnchor.h
index 021a930d..c804aff5 100644
--- a/WWW/Library/Implementation/HTAnchor.h
+++ b/WWW/Library/Implementation/HTAnchor.h
@@ -1,5 +1,5 @@
 /*
- * $LynxId: HTAnchor.h,v 1.36 2012/08/15 10:48:24 tom Exp $
+ * $LynxId: HTAnchor.h,v 1.37 2013/10/02 23:21:55 tom Exp $
  *
  *	Hypertext "Anchor" Object				     HTAnchor.h
  *	==========================
@@ -224,6 +224,8 @@ extern "C" {
      */
     extern char *HTAnchor_address(HTAnchor * me);
 
+    extern char *HTAnchor_short_address(HTAnchor * me);
+
     extern void HTAnchor_setFormat(HTParentAnchor *me,
 				   HTFormat form);
 
diff --git a/src/LYList.c b/src/LYList.c
index ff0b5e0c..b310c825 100644
--- a/src/LYList.c
+++ b/src/LYList.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYList.c,v 1.51 2013/04/30 22:09:43 tom Exp $
+ * $LynxId: LYList.c,v 1.52 2013/10/02 23:22:43 tom Exp $
  *
  *			Lynx Document Reference List Support	      LYList.c
  *			====================================
@@ -286,11 +286,16 @@ static int print_refs(FILE *fp, int titles, int refs)
 			continue;
 		    fprintf(fp, "%4d. ", value);
 		}
-		address = HTAnchor_address(dest);
-		fprintf(fp, "%s%s\n",
-			((HTAnchor *) parent != dest) && title ? "in " : "",
-			(title ? title : address));
-		FREE(address);
+		if (((HTAnchor *) parent != dest) && title) {
+		    fprintf(fp, "in ");
+		}
+		if (title) {
+		    fprintf(fp, "%s\n", title);
+		} else {
+		    address = HTAnchor_short_address(dest);
+		    fprintf(fp, "%s\n", address);
+		    FREE(address);
+		}
 	    }
 	}
 	if (counter > result)