about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/HTML.c9
-rw-r--r--src/HTML.h1
-rw-r--r--src/LYKeymap.c3
-rw-r--r--src/LYKeymap.h91
-rw-r--r--src/LYMail.c48
-rw-r--r--src/LYMain.c2
-rw-r--r--src/LYMainLoop.c64
7 files changed, 157 insertions, 61 deletions
diff --git a/src/HTML.c b/src/HTML.c
index dcdb5fbe..9ecfb095 100644
--- a/src/HTML.c
+++ b/src/HTML.c
@@ -498,7 +498,13 @@ PRIVATE void HTML_start_element ARGS5(
 
 	    StrAllocCopy(base, (char *)value[HTML_BASE_HREF]);
 	    if (!(url_type = LYLegitimizeHREF(me, (char**)&base, TRUE))) {
-	        HTAlert(BASE_NOT_ABSOLUTE);
+	        if (TRACE)
+		    fprintf(stderr,
+		    	    "HTML: BASE '%s' is not an absolute URL.\n",
+			    (base ? base : ""));
+		if (me->inBadBASE == FALSE)
+	            HTAlert(BASE_NOT_ABSOLUTE);
+		me->inBadBASE = TRUE;
 	    }
 
 	    /* 
@@ -5647,6 +5653,7 @@ PUBLIC HTStructured* HTML_new ARGS3(
     me->inA = FALSE;
     me->inAPPLET = FALSE;
     me->inAPPLETwithP = FALSE;
+    me->inBadBASE = FALSE;
     me->inBadHTML = FALSE;
     me->inBASE = FALSE;
     me->inBoldA = FALSE;
diff --git a/src/HTML.h b/src/HTML.h
index 23d89e17..c4bd3caf 100644
--- a/src/HTML.h
+++ b/src/HTML.h
@@ -113,6 +113,7 @@ struct _HTStructured {
     BOOL		inA;
     BOOL		inAPPLET;
     BOOL		inAPPLETwithP;
+    BOOL		inBadBASE;
     BOOL		inBadHTML;
     BOOL		inBASE;
     BOOL		inBoldA;
diff --git a/src/LYKeymap.c b/src/LYKeymap.c
index 62382e44..af1e19de 100644
--- a/src/LYKeymap.c
+++ b/src/LYKeymap.c
@@ -89,7 +89,7 @@ LYK_DIRED_MENU,
 #endif /* DIRED_SUPPORT || VMS */
 /* F */        
 
-LYK_GOTO,
+LYK_ECGOTO,
 /* G */
 
 LYK_HELP,            LYK_INDEX,      LYK_JUMP,      LYK_KEYMAP,
@@ -420,6 +420,7 @@ PRIVATE struct rmap revmap[] = {
 { "PREV_DOC",		"go back to the previous document" },
 { "ACTIVATE",		"go to the document given by the current link" },
 { "GOTO",		"go to a document given as a URL" },
+{ "ECGOTO",		"edit the current document's URL and go to it" },
 { "HELP",		"display help on using the browser" },
 { "INDEX",		"display an index of potentially useful documents" },
 { "NOCACHE",		"force submission of form or link with no-cache" },
diff --git a/src/LYKeymap.h b/src/LYKeymap.h
index 1ed08cf2..a06b7942 100644
--- a/src/LYKeymap.h
+++ b/src/LYKeymap.h
@@ -55,57 +55,58 @@ extern char override[];
 #define       LYK_PREV_DOC      31
 #define       LYK_ACTIVATE      32
 #define       LYK_GOTO  	33
-#define       LYK_HELP  	34
-#define       LYK_INDEX 	35
-#define       LYK_NOCACHE       36
-#define       LYK_INTERRUPT     37
-#define       LYK_MAIN_MENU     38
-#define       LYK_OPTIONS       39
-#define       LYK_INDEX_SEARCH  40
-#define       LYK_WHEREIS       41
-#define       LYK_NEXT  	42
-#define       LYK_COMMENT       43
-#define       LYK_EDIT  	44
-#define       LYK_INFO  	45
-#define       LYK_PRINT 	46
-#define       LYK_ADD_BOOKMARK  47
-#define       LYK_DEL_BOOKMARK  48
-#define       LYK_VIEW_BOOKMARK 49
-#define       LYK_VLINKS	50
-#define       LYK_SHELL 	51
-#define       LYK_DOWNLOAD      52
-#define       LYK_TRACE_TOGGLE  53
-#define       LYK_IMAGE_TOGGLE  54
-#define       LYK_INLINE_TOGGLE 55
-#define       LYK_HEAD          56
-#define       LYK_DO_NOTHING    57
-#define       LYK_TOGGLE_HELP	58
-#define       LYK_JUMP		59
-#define       LYK_KEYMAP	60
-#define       LYK_LIST		61
-#define       LYK_TOOLBAR	62
-#define       LYK_HISTORICAL	63
-#define       LYK_MINIMAL	64
-#define       LYK_SOFT_DQUOTES	65
-#define       LYK_RAW_TOGGLE	66
-#define       LYK_COOKIE_JAR    67
+#define       LYK_ECGOTO  	34
+#define       LYK_HELP  	35
+#define       LYK_INDEX 	36
+#define       LYK_NOCACHE       37
+#define       LYK_INTERRUPT     38
+#define       LYK_MAIN_MENU     39
+#define       LYK_OPTIONS       40
+#define       LYK_INDEX_SEARCH  41
+#define       LYK_WHEREIS       42
+#define       LYK_NEXT  	43
+#define       LYK_COMMENT       44
+#define       LYK_EDIT  	45
+#define       LYK_INFO  	46
+#define       LYK_PRINT 	47
+#define       LYK_ADD_BOOKMARK  48
+#define       LYK_DEL_BOOKMARK  49
+#define       LYK_VIEW_BOOKMARK 50
+#define       LYK_VLINKS	51
+#define       LYK_SHELL 	52
+#define       LYK_DOWNLOAD      53
+#define       LYK_TRACE_TOGGLE  54
+#define       LYK_IMAGE_TOGGLE  55
+#define       LYK_INLINE_TOGGLE 56
+#define       LYK_HEAD          57
+#define       LYK_DO_NOTHING    58
+#define       LYK_TOGGLE_HELP	59
+#define       LYK_JUMP		60
+#define       LYK_KEYMAP	61
+#define       LYK_LIST		62
+#define       LYK_TOOLBAR	63
+#define       LYK_HISTORICAL	64
+#define       LYK_MINIMAL	65
+#define       LYK_SOFT_DQUOTES	66
+#define       LYK_RAW_TOGGLE	67
+#define       LYK_COOKIE_JAR    68
 
 #ifdef VMS
-#define       LYK_DIRED_MENU    68
+#define       LYK_DIRED_MENU    69
 #endif /* VMS */
 #ifdef DIRED_SUPPORT
-#define       LYK_DIRED_MENU    68
-#define       LYK_CREATE        69
-#define       LYK_REMOVE        70
-#define       LYK_MODIFY        71
-#define       LYK_TAG_LINK      72
-#define       LYK_UPLOAD        73
-#define       LYK_INSTALL       74
+#define       LYK_DIRED_MENU    69
+#define       LYK_CREATE        70
+#define       LYK_REMOVE        71
+#define       LYK_MODIFY        72
+#define       LYK_TAG_LINK      73
+#define       LYK_UPLOAD        74
+#define       LYK_INSTALL       75
 #endif /* DIRED_SUPPORT */
 #ifdef NOT_USED
-#define       LYK_VERSION	75
-#define       LYK_FORM_UP       76
-#define       LYK_FORM_DOWN     77
+#define       LYK_VERSION	76
+#define       LYK_FORM_UP       77
+#define       LYK_FORM_DOWN     78
 #endif /* NOT_USED */
 
 #endif /* LYKEYMAP_H */
diff --git a/src/LYMail.c b/src/LYMail.c
index a0855064..0a2cc1c6 100644
--- a/src/LYMail.c
+++ b/src/LYMail.c
@@ -308,7 +308,7 @@ PUBLIC void mailform ARGS4(
 PUBLIC void mailmsg ARGS4(int,cur, char *,owner_address, 
 		char *,filename, char *,linkname)
 {
-    FILE *fd;
+    FILE *fd, *fp;
     char *address = NULL;
     char cmd[512], *cp, *cp0, *cp1;
     int i;
@@ -349,7 +349,7 @@ PUBLIC void mailmsg ARGS4(int,cur, char *,owner_address,
 
 #ifdef UNIX
 #ifdef MMDF
-    sprintf(cmd, "%s -mlruxto,cc\\*",system_mail);
+    sprintf(cmd, "%s -mlruxto,cc\\*", system_mail);
 #else
     sprintf(cmd, "%s -t -oi", system_mail);
 #endif /* MMDF */
@@ -362,27 +362,32 @@ PUBLIC void mailmsg ARGS4(int,cur, char *,owner_address,
     fprintf(fd,"To: %s\n", address);
     fprintf(fd,"Subject: Lynx Error in %s\n", filename);
     fprintf(fd,"X-URL: %s\n", filename);
-    fprintf(fd,"X-Mailer: Lynx, Version %s\n\n",LYNX_VERSION);
+    fprintf(fd,"X-Mailer: Lynx, Version %s\n\n", LYNX_VERSION);
 #endif /* UNIX */
 #ifdef VMS
-    sprintf(tmpfile,"%s%s",lynx_temp_space, "temp_mail.txt");
+    sprintf(tmpfile, "%s%s", lynx_temp_space, "temp_mail.txt");
     if ((fd = fopen(tmpfile,"w")) == NULL) {
 	FREE(address);
 	return;
     }
-
 #endif /* VMS */
 
     fprintf(fd, "The link   %s :?: %s \n",
     		links[cur].lname, links[cur].target);
-    fprintf(fd, "called \"%s\"\n",links[cur].hightext);
+    fprintf(fd, "called \"%s\"\n", links[cur].hightext);
     fprintf(fd, "in the file \"%s\" called \"%s\"", filename, linkname);
 
     fputs("\nwas requested but was not available.",fd);
     fputs("\n\nThought you might want to know.",fd);
 
-    fputs("\n\nThis message was automatically generated by\n",fd);
-    fprintf(fd,"Lynx ver. %s",LYNX_VERSION);
+    fputs("\n\nThis message was automatically generated by\n", fd);
+    fprintf(fd, "Lynx ver. %s", LYNX_VERSION);
+    if ((LynxSigFile != NULL) &&
+        (fp = fopen(LynxSigFile, "r")) != NULL) {
+	while (fgets(cmd, sizeof(cmd), fp) != NULL)
+	    fputs(cmd, fd);
+	fclose(fp);
+    }
 #ifdef UNIX
     pclose(fd);
 #endif /* UNIX */
@@ -451,7 +456,7 @@ PUBLIC void reply_by_mail ARGS3(
 	char *,		title)
 {
     char user_input[1000];
-    FILE *fd;
+    FILE *fd, *fp;
     char *address = NULL;
     char *searchpart = NULL;
     char *body = NULL;
@@ -468,7 +473,6 @@ PUBLIC void reply_by_mail ARGS3(
 #else
     char buf[512];
     char *header = NULL;
-    FILE *fp;
     int n;
 #endif /* VMS */
 
@@ -1031,12 +1035,30 @@ PUBLIC void reply_by_mail ARGS3(
     while (TOUPPER(c) != 'Y' && TOUPPER(c) != 'N' &&
 	   !term_letter && c != 7   && c != 3)
 	c = LYgetch();
-
-    clear();  /* Clear the screen. */
-
     if (TOUPPER(c) != 'Y') {
+        clear();  /* clear the screen */
 	goto cleanup;
     }
+    if ((body == NULL && LynxSigFile != NULL) &&
+        (fp = fopen(LynxSigFile, "r")) != NULL) {
+	LYStatusLine = (LYlines - 1);
+	_user_message(APPEND_SIG_FILE, LynxSigFile);
+	c = 0;
+        LYStatusLine = -1;
+	while (TOUPPER(c) != 'Y' && TOUPPER(c) != 'N' &&
+	       !term_letter && c != 7   && c != 3)
+	    c = LYgetch();
+	if (TOUPPER(c) == 'Y') {
+	    if ((fd = fopen(tmpfile, "a")) != NULL) {
+	        while (fgets(user_input, sizeof(user_input), fp) != NULL) {
+		    fputs(user_input, fd);
+		}
+		fclose(fd);
+	    }
+	}
+	fclose(fp);
+    }
+    clear();  /* Clear the screen. */
 
     /*
      *  Send the message.
diff --git a/src/LYMain.c b/src/LYMain.c
index 22d299a7..f621bf00 100644
--- a/src/LYMain.c
+++ b/src/LYMain.c
@@ -2047,7 +2047,7 @@ Output_Help_List:
     printf("                     with the PREV_DOC command or from the History List\n");
     printf("    -rlogin          disable rlogins\n");
     printf("    -selective       require .www_browsable files to browse directories\n");
-    printf("    -show_cursor     toggles hiding of the curser in the lower right corner\n");
+    printf("    -show_cursor     toggles hiding of the cursor in the lower right corner\n");
     printf("    -soft_dquotes    toggles emulation of the old Netscape and Mosaic bug which\n");
     printf("                     treated '>' as a co-terminator for double-quotes and tags\n");
     printf("    -source          dump the source of the first file to stdout and exit\n");
diff --git a/src/LYMainLoop.c b/src/LYMainLoop.c
index da7c818f..72e0d96c 100644
--- a/src/LYMainLoop.c
+++ b/src/LYMainLoop.c
@@ -2146,6 +2146,69 @@ new_cmd:  /*
 	    }
 	    break;
 
+	case LYK_ECGOTO:   /* edit current URL and go to to it  */
+	    if (no_goto && !LYValidate) {
+	        if (old_c != real_c) {
+	   	    old_c = real_c;
+	    	    _statusline(GOTO_DISALLOWED);
+		    sleep(MessageSecs);
+		}
+		break;
+	    }
+
+	    /*
+	     *  Save the current user_input_buffer string,
+	     *  and load the current document's address.
+	     */
+	    StrAllocCopy(temp, user_input_buffer);
+	    LYstrncpy(user_input_buffer,
+	    	      curdoc.address,
+		      (sizeof(user_input_buffer) - 1));
+
+	    /*
+	     *  Warn the user if the current document has POST
+	     *  data associated with it. - FM
+	     */
+	    if (curdoc.post_data)
+	        HTAlert(CURRENT_DOC_HAS_POST_DATA);
+
+	    /*
+	     *  Offer the current document's URL for editing. - FM
+	     */
+	    _statusline(EDIT_CURDOC_URL);
+	    if (((ch = LYgetstr(user_input_buffer, VISIBLE,
+	    		        sizeof(user_input_buffer), RECALL)) >= 0) &&
+		user_input_buffer[0] != '\0' &&
+		strcmp(user_input_buffer, curdoc.address)) {
+		LYTrimHead(user_input_buffer);
+		if (!strncasecomp(user_input_buffer, "lynxexec:", 9) ||
+		    !strncasecomp(user_input_buffer, "lynxprog:", 9)) {
+		    /*
+		     *  The original implementations of these schemes expected
+		     *  white space without hex escaping, and did not check
+		     *  for hex escaping, so we'll continue to support that,
+		     *  until that code is redone in conformance with SGML
+		     *  principles.  - FM
+		     */
+		    HTUnEscapeSome(user_input_buffer, " \r\n\t");
+		    convert_to_spaces(user_input_buffer, TRUE);
+		} else {
+		    collapse_spaces(user_input_buffer);
+		}
+		if (user_input_buffer[0] != '\0') {
+		    goto check_goto_URL;
+		}
+	    }
+	    /*
+	     *  User cancelled via ^G, a full deletion,
+	     *  or not modifying the URL. - FM
+	     */
+	    _statusline(CANCELLED);
+	    sleep(InfoSecs);
+	    strcpy(user_input_buffer, temp);
+	    FREE(temp);
+	    break;
+
 	case LYK_GOTO:   /* 'g' to goto a random URL  */
 	    if (no_goto && !LYValidate) {
 	        if (old_c != real_c) {
@@ -2307,6 +2370,7 @@ check_recall:
 		}
 	    }
 
+check_goto_URL:
 	    /*
 	     *  If its not a URL then make it one.
 	     */