about summary refs log tree commit diff stats
path: root/src/LYList.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/LYList.c')
-rw-r--r--src/LYList.c56
1 files changed, 31 insertions, 25 deletions
diff --git a/src/LYList.c b/src/LYList.c
index f5225c7b..255c6671 100644
--- a/src/LYList.c
+++ b/src/LYList.c
@@ -21,12 +21,12 @@
 
 #include "LYexit.h"
 #include "LYLeaks.h"
- 
+
 #define FREE(x) if (x) {free(x); x = NULL;}
 
-/* 	showlist - F.Macrides (macrides@sci.wfeb.edu)
+/*	showlist - F.Macrides (macrides@sci.wfeb.edu)
 **	--------
-**  	Create a temporary text/html file with a list of links to
+**	Create a temporary text/html file with a list of links to
 **	HyperText References in the current document.
 **
 **  On entry
@@ -118,11 +118,16 @@ PUBLIC int showlist ARGS2(
 		 LIST_PAGE_TITLE);
     fprintf(fp0, "<h1>You have reached the List Page</h1>\n");
     fprintf(fp0, "<h2>%s Version %s</h2>\n", LYNX_NAME, LYNX_VERSION);
-
-    fprintf(fp0, "  References in this document:<p>\n");
+    StrAllocCopy(Address, HTLoadedDocumentURL());
+    LYEntify(&Address, FALSE);
+    fprintf(fp0,
+	    "  References in %s<p>\n",
+	    ((Address != NULL && *Address != '\0') ?
+					   Address : "this document:"));
+    FREE(Address);
     if (refs > 0) {
 	fprintf(fp0, "<%s compact>\n", ((keypad_mode == NUMBERS_AS_ARROWS) ?
-    				       "ol" : "ul"));
+				       "ol" : "ul"));
 	if (hidden_links > 0)
 	    fprintf(fp0, "<lh><em>Visible links:</em>\n");
     }
@@ -154,8 +159,8 @@ PUBLIC int showlist ARGS2(
 	     */
 	    if (keypad_mode == LINKS_AND_FORM_FIELDS_ARE_NUMBERED) {
 		HText_FormDescNumber(cnt, (char **)&desc);
-		/* fprintf(fp0, "<li>[%d](<em>%s</em>)\n", cnt, desc); */
-		fprintf(fp0, "<li><a id=%d href='#%d'></a>(<em>%s</em>)\n",
+		fprintf(fp0,
+		"<li><a id=%d href=\"#%d\">form field</a> = <em>%s</em>\n",
 			cnt, cnt, desc);
 	    }
 	    continue;
@@ -196,8 +201,8 @@ PUBLIC int showlist ARGS2(
 	}
 
         fprintf(fp0, "<li><a href=\"%s\"%s>%s%s%s%s%s</a>\n", Address,
-		        dest_intl ? " TYPE=\"internal link\"" : "", 
-		        dest_intl ? "(internal) " : "", 
+		        dest_intl ? " TYPE=\"internal link\"" : "",
+		        dest_intl ? "(internal) " : "",
 			((HTAnchor*)parent != dest) && Title ? "in " : "",
 			(char *)(Title ? Title : Address),
 			(Title && cp) ? " - " : "",
@@ -210,11 +215,11 @@ PUBLIC int showlist ARGS2(
     if (hidden_links > 0) {
         if (refs > 0)
 	    fprintf(fp0, "\n</%s>\n\n<p>\n",
-	    		 ((keypad_mode == NUMBERS_AS_ARROWS) ?
-						        "ol" : "ul"));
-        fprintf(fp0, "<%s compact>\n", ((keypad_mode == NUMBERS_AS_ARROWS) ?
-    				        "ol continue" : "ul"));
-        fprintf(fp0, "<lh><em>Hidden links:</em>\n");
+			 ((keypad_mode == NUMBERS_AS_ARROWS) ?
+							"ol" : "ul"));
+	fprintf(fp0, "<%s compact>\n", ((keypad_mode == NUMBERS_AS_ARROWS) ?
+					"ol continue" : "ul"));
+	fprintf(fp0, "<lh><em>Hidden links:</em>\n");
     }
 
     for (cnt = 0; cnt < hidden_links; cnt++) {
@@ -230,7 +235,7 @@ PUBLIC int showlist ARGS2(
     }
 
     fprintf(fp0,"\n</%s>\n</body>\n", ((keypad_mode == NUMBERS_AS_ARROWS) ?
-    				       "ol" : "ul"));
+				       "ol" : "ul"));
 
     /*
      *  Make necessary changes to newdoc before returning to caller.
@@ -254,11 +259,11 @@ PUBLIC int showlist ARGS2(
     newdoc->safe = FALSE;
     fclose(fp0);
     return(0);
-}      
+}
 
-/* 	printlist - F.Macrides (macrides@sci.wfeb.edu)
+/*	printlist - F.Macrides (macrides@sci.wfeb.edu)
 **	---------
-**  	Print a text/plain list of HyperText References
+**	Print a text/plain list of HyperText References
 **	in the current document.
 **
 **  On entry
@@ -301,13 +306,14 @@ PUBLIC void printlist ARGS2(
 		 *  child should not be 0 unless form field numbering is on
 		 *  and cnt is the number of a form intput field.
 		 *  HText_FormDescNumber() will set desc to a description
-		 *  of what type of input field this is.  We'll list it to
-		 *  ensure that the link numbers on the list page match the
-		 *  numbering in the original document. - FM && LE
+		 *  of what type of input field this is.  We'll create a
+		 *  within-document link to ensure that the link numbers on
+		 *  the list page match the numbering in the original document,
+		 *  but won't create a forward link to the form. - FM && LE
 		 */
 		if (keypad_mode == LINKS_AND_FORM_FIELDS_ARE_NUMBERED) {
 		    HText_FormDescNumber(cnt, (char **)&desc);
-		    fprintf(fp, "%4d. (%s)\n", cnt, desc);
+		    fprintf(fp, "%4d. form field = %s\n", cnt, desc);
 		}
 		continue;
 	    }
@@ -330,7 +336,7 @@ PUBLIC void printlist ARGS2(
 	    FREE(address);
 #ifdef VMS
 	    if (HadVMSInterrupt)
-	        break;
+		break;
 #endif /* VMS */
 	}
 
@@ -351,4 +357,4 @@ PUBLIC void printlist ARGS2(
 	}
     }
     return;
-}      
+}