[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lynx-dev [patch] 2.8.3dev.16 - cookie_save_file

From: brian j pardy
Subject: Re: lynx-dev [patch] 2.8.3dev.16 - cookie_save_file
Date: Wed, 15 Dec 1999 19:30:51 -0500

On Wed, Dec 15, 1999, Klaus Weide wrote:
> I note that still nothing has been done for -source.  So non-interactive
> in general still isn't covered.  Apologies if I missed such a change, but
> I don't think so.

What do you think of this?

Change HTFWriter_free() so that it is allowed to return instead of
calling exit_immediately().  This will (somehow -- I traced it from
the back, not the front) lead to getfile() returning NULLFILE.  The
LYMainLoop.c change there is for when we get a NULLFILE back from
getfile() -- if we're in dump mode, go ahead and return a 0 from
mainloop().  Since we're calling this from dump mode, all that happens
afterward is to print the references list (if necessary), then to do
LYMain.c's already existing LYStoreCookies (if persistent &&
EXP_PERSISTENT_COOKIES), then call cleanup_files() and
exit_immediately(status) (0).

Since calling cleanup_files() seems to be safe for -dump, at the
least, I just assumed it would be safe for a -source as well.  I don't
know what it might be free'ing that isn't allocated in -source mode,
so I wouldn't be surprised if someone else got a segfault on this.  I
haven't had any.  I don't understand enough (read: anything) to know
if various newdoc etc pointers will have been populated and improperly

FWIW, it seems to work for me. YMMV.

diff -ru 2.8.3dev.17/src/HTFWriter.c 2.8.3dev.17.bri/src/HTFWriter.c
--- 2.8.3dev.17/src/HTFWriter.c Wed Dec 15 18:22:16 1999
+++ 2.8.3dev.17.bri/src/HTFWriter.c     Wed Dec 15 19:15:32 1999
@@ -419,8 +419,14 @@
     if (dump_output_immediately) {
        if (me->anchor->FileCache)
-       FREE(me);
-       exit_immediately(0);
+       /*
+        * Let's not exit immediately -- go ahead and return as though
+        * this was interactive mode, let getfile() return NULLFILE and
+        * check for dump_output_immediately mode in mainloop(), and 
+        * clean up there. - BJP
+        */
+       /* FREE(me); */
+       /* exit_immediately(0); */
diff -ru 2.8.3dev.17/src/LYMainLoop.c 2.8.3dev.17.bri/src/LYMainLoop.c
--- 2.8.3dev.17/src/LYMainLoop.c        Wed Dec 15 18:22:16 1999
+++ 2.8.3dev.17.bri/src/LYMainLoop.c    Wed Dec 15 19:22:44 1999
@@ -5540,6 +5540,9 @@
                           newdoc.internal_link = FALSE;
                           goto try_again;
                        } else {
+                          if (dump_output_immediately)
+                              return(0);

Do infants have as much fun in infancy as adults do in adultery?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]