[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
lynx-dev [2.8.1dev.25] patch - small bug in LYLoadCookies()
From: |
brian j. pardy |
Subject: |
lynx-dev [2.8.1dev.25] patch - small bug in LYLoadCookies() |
Date: |
Mon, 7 Sep 1998 13:52:59 -0700 |
This patch fixes a small bug in LYLoadCookies() which was creating an
invalid cookie in memory (and then writing it out to the cookie file) when
loading persistent cookies from a file -- a blank line in the file would
lead to LYLoadCookies creating a new cookie with an empty domain.
LYStoreCookies() writes the blank line to the end of the file. I don't
think this a problem with LYLoadCookies() handling it properly.
diff -cr lynx2.8.1dev.25/src/LYCookie.c lynx2.8.1dev.25.bri/src/LYCookie.c
*** lynx2.8.1dev.25/src/LYCookie.c Mon Sep 7 03:02:16 1998
--- lynx2.8.1dev.25.bri/src/LYCookie.c Mon Sep 7 13:47:21 1998
***************
*** 1845,1852 ****
int tok_loop;
char *tok_values[] = {domain, what, path, secure, expires_a, name,
value, NULL};
char *tok_out, *tok_ptr;
! fgets(buf, 4999, cookie_handle); /* test return value */
/*
* Tokenise the cookie line into it's component parts -
--- 1845,1857 ----
int tok_loop;
char *tok_values[] = {domain, what, path, secure, expires_a, name,
value, NULL};
char *tok_out, *tok_ptr;
+ int j;
! j = fgets(buf, 4999, cookie_handle);
!
! if((j == NULL) || (buf[0] == '\0' || buf[0] == '\n')) {
! break;
! }
/*
* Tokenise the cookie line into it's component parts -
--
Live fast, die young, and leave a good looking corpse.
-- James Dean
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- lynx-dev [2.8.1dev.25] patch - small bug in LYLoadCookies(),
brian j. pardy <=