On Wed, Feb 22, 2012 at 07:19:28PM -0500, Thomas Dickey wrote:
> On Wed, Feb 22, 2012 at 10:37:00PM +0000, Thorsten Glaser wrote:
> > Hi,
> > 
> > dev.11, lynx, startfile is my $HOME, I hit O, change something
> > (e.g. send user-agent checkbox), confirm and get:
> > 
> > Alert!: Reloading document. Any form entries will be lost!
> > 
> > The document of course contains no forms.
> 
> The problem is this change:
> 
> * modify HTLoadDocument() to not retain a cached document if user is 
> explicitly
>   doing a refresh.  This fixes the case for a #fragment url, which was
>   otherwise treated as the same as the address without the #fragment -TD
> 
> ...which was the change to HTAccess in dev.10:
...
> I guess that's going to be dev.12 (dev.13 presumably will have a
> fix for the original problem...)

Thinking about it, I can repair this and keep the fix for the
original problem (unless there's some other gotcha).

The attached patch narrows down the dev.10 change so that it applies
only to the condition that I intended.

-- 
Thomas E. Dickey <[email protected]>
http://invisible-island.net
ftp://invisible-island.net
# patch by Thomas E. Dickey <[email protected]>
# created  Thu Feb 23 00:45:20 UTC 2012
# ------------------------------------------------------------------------------
# CHANGES                               |    7 ++++++-
# WWW/Library/Implementation/HTAccess.c |    4 ++--
# WWW/Library/Implementation/HTTP.h     |    8 +++++++-
# src/LYMainLoop.c                      |    4 ++--
# 4 files changed, 17 insertions(+), 6 deletions(-)
# ------------------------------------------------------------------------------
Index: CHANGES
--- lynx2.8.8dev.11+/CHANGES	2012-02-20 01:34:18.000000000 +0000
+++ lynx2.8.8dev.11a/CHANGES	2012-02-23 00:42:23.000000000 +0000
@@ -1,8 +1,13 @@
--- $LynxId: CHANGES,v 1.593 2012/02/20 01:34:18 tom Exp $
+-- $LynxId: CHANGES,v 1.595 2012/02/23 00:42:23 tom Exp $
 ===============================================================================
 Changes since Lynx 2.8 release
 ===============================================================================
 
+2012-02-22 (2.8.8dev.12)
+* amend the dev.10 change to HTLoadDocument(), which broke caching of forms,
+  to limit it to just the case where the user has pressed ^R, etc (report by
+  TG) -TD
+
 2012-02-19 (2.8.8dev.11)
 * correct help-message for -html5_charset option -Kihara Hideto
 * correct a typo in strtol change from dev.10 which caused hexadecimal numeric
Index: WWW/Library/Implementation/HTAccess.c
--- lynx2.8.8dev.11+/WWW/Library/Implementation/HTAccess.c	2012-02-04 00:15:53.000000000 +0000
+++ lynx2.8.8dev.11a/WWW/Library/Implementation/HTAccess.c	2012-02-23 00:39:40.000000000 +0000
@@ -1,5 +1,5 @@
 /*
- * $LynxId: HTAccess.c,v 1.76 2012/02/04 00:15:53 tom Exp $
+ * $LynxId: HTAccess.c,v 1.77 2012/02/23 00:39:40 tom Exp $
  *
  *		Access Manager					HTAccess.c
  *		==============
@@ -895,7 +895,7 @@
 	 * based on an If-Modified-Since check, etc.) but the code for doing
 	 * those other things isn't available yet.
 	 */
-	if (!reloading &&
+	if ((reloading != REAL_RELOAD) &&
 	    (LYoverride_no_cache ||
 #ifdef DONT_TRACK_INTERNAL_LINKS
 	     !HText_hasNoCacheSet(text) ||
Index: WWW/Library/Implementation/HTTP.h
--- lynx2.8.8dev.11+/WWW/Library/Implementation/HTTP.h	2009-04-07 22:44:50.000000000 +0000
+++ lynx2.8.8dev.11a/WWW/Library/Implementation/HTTP.h	2012-02-23 00:41:07.000000000 +0000
@@ -1,5 +1,5 @@
 /*
- * $LynxId: HTTP.h,v 1.10 2009/04/07 22:44:50 tom Exp $
+ * $LynxId: HTTP.h,v 1.11 2012/02/23 00:41:07 tom Exp $
  *
  * /Net/dxcern/userd/timbl/hypertext/WWW/Library/Implementation/HTTP.html
  *                                HYPERTEXT TRANFER PROTOCOL
@@ -25,6 +25,12 @@
 #define URL_POST_METHOD 2
 #define URL_MAIL_METHOD 3
 
+    /*
+     * Special value for 'reloading' used to tell HTLoadDocument() that the
+     * user asked for a reload, versus Lynx doing a reload for other reasons.
+     */
+#define REAL_RELOAD (TRUE + 1)
+
     extern int ws_read_per_sec;
     extern BOOLEAN reloading;
     extern char *redirecting_url;
Index: src/LYMainLoop.c
--- lynx2.8.8dev.11+/src/LYMainLoop.c	2012-02-13 00:29:19.000000000 +0000
+++ lynx2.8.8dev.11a/src/LYMainLoop.c	2012-02-23 00:39:12.000000000 +0000
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYMainLoop.c,v 1.206 2012/02/13 00:29:19 tom Exp $
+ * $LynxId: LYMainLoop.c,v 1.207 2012/02/23 00:39:12 tom Exp $
  */
 #include <HTUtils.h>
 #include <HTAccess.h>
@@ -4387,7 +4387,7 @@
      * RAW_TOGGLE, etc.  - KW
      */
     if (real_cmd == LYK_RELOAD)
-	reloading = TRUE;
+	reloading = REAL_RELOAD;
 
     return;
 }

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Lynx-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lynx-dev

Reply via email to