lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev 2.8.3dev.2 patch 5 - LYstrsep


From: Klaus Weide
Subject: lynx-dev 2.8.3dev.2 patch 5 - LYstrsep
Date: Thu, 24 Jun 1999 21:47:21 -0500 (CDT)

The LYstrsep() function seems to have gone through several revisions,
I haven't tried to dig deep in its history but the part of its
behavior addresses below seems still wrong.

This change doesn't break anything (LYstrsep() is only used in two
situations, in one of them unnecessarily), In fact it makes correct
reading of empty string cookie values form file possible *without* the line

            buf[i++] = '\t';    /* add sep after line if enough space - kw */

added in my previous patch 4.  (IOW with this patch and patch 4, there
are now two lines of defense against "losing a cookie value".)

Btw a version of Netscape Navigator seems to have just the "losing a
cookie value" bug I'm trying to prevent: cookies with empty values are
written to the cookie file, but disappear when the cookie file is read
the next time.  Storing cookies with empty value may not be very useful
in practice, but it seems to be the right thing, I didn't find anything
that forbids 0-lenght cookie values when I checked ( a while ago).
NN doesn't seem to drop then intentionally - otherwise why would they
be written out to the file at all.

   Klaus

* Removed special handling for empty last field from LYstrsep(), which
  made it act differently from (GNU) C library's strsep().

Index: lynx2-8-3/src/LYStrings.c
--- lynx2-8-3.old/src/LYStrings.c Mon, 21 Jun 1999 00:31:29 -0500
+++ lynx2-8-3/src/LYStrings.c Thu, 24 Jun 1999 21:18:22 -0500
@@ -2737,11 +2737,6 @@
     if (!stringp || !*stringp)         /* nothing to do? */
        return 0;                       /* then don't fall on our faces */
 
-    if (!**stringp) {                  /* empty string: */
-       *stringp = 0;                   /* let caller see he's done; */
-       return 0;                       /* no tokens in an empty string */
-    }
-
     out = *stringp;                    /* save the start of the string */
     tmp = strpbrk(*stringp, delim);
     if (tmp) {


reply via email to

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