[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lynx-dev COOKIE_SAVE_FILE wrong (was: strange behavior in lynx 2.8.3
From: |
brian j pardy |
Subject: |
Re: lynx-dev COOKIE_SAVE_FILE wrong (was: strange behavior in lynx 2.8.3 dev 17) |
Date: |
Sun, 19 Dec 1999 14:34:27 -0500 |
On Sun, Dec 19, 1999, Klaus Weide wrote:
> On Sun, 19 Dec 1999, Larry W. Virden wrote:
[...]
> > Lynx was compiled from a freshly downloaded source tar file
> > and fresh configure run.
> >
> > When I say
> > lynx -trace http://mail.yahoo.com/
> > today, then I log into mail.yahoo.com and quit, I see:
> >
> > LYStoreCookies: save cookies to ~/.parms/lynx_cookies on exit
> >
> > as the last line of ouput.
>
> The '~' should have been expanded at this point, but for some reason
> that hasn't happened. So LYStoreCookies() tries to open a file
> literally named "~/.parms/lynx_cookies" which is bound to fail (unless
> you happen to have a subdirectory named "~" and witing that a
> subdirectory named ".parms").
>
> LYStoreCookies() doesn't give any meaningful trace message about the
> failure and just returns.
>
> Brian, any idea what went wrong here? I haven't traced it, but
> the stuff in LYMain.c *looks* right to me.
>
> Larry, you can probably work around the problem by putting the full
> expanded name (no '~') in COOKIE_FILE in your lynx.cfg (and possibly
> COOKIE_SAVE_FILE) - untested.
Yep, it was my fault. Here's a patch. Not intentionally obfuscated,
but diff decided to do it this way.
The old way:
if (dump_output_immediately) {
if (LYCookieSaveFile != NULL) {
[tilde expand LYCookieSaveFile]
}
} else {
StrAllocCopy(LYCookieSaveFile, "/dev/null");
}
} else {
if (LYCookieSaveFile == NULL) {
StrAllocCopy(LYCookieSaveFile, LYCookieFile);
}
}
Now it attempts to expand LYCookieSaveFile before it worries about what
mode we're in.
diff -ru 2.8.3dev.17/src/LYMain.c 2.8.3dev.17.bri/src/LYMain.c
--- 2.8.3dev.17/src/LYMain.c Wed Dec 15 18:22:16 1999
+++ 2.8.3dev.17.bri/src/LYMain.c Sun Dec 19 14:28:37 1999
@@ -1605,29 +1605,28 @@
LYLoadCookies(LYCookieFile);
}
+ /* tilde-expand LYCookieSaveFile */
+ if (LYCookieSaveFile != NULL) {
+ if (LYCookieSaveFile[0] == '~' && LYCookieSaveFile[1] == '/' &&
+ LYCookieSaveFile[2] != '\0') {
+ temp = NULL;
+ StrAllocCopy(temp, LYCookieSaveFile + 2);
+ StrAllocCopy(LYCookieSaveFile, wwwName(Home_Dir()));
+ LYAddPathSep(&LYCookieSaveFile);
+ StrAllocCat(LYCookieSaveFile, temp);
+ FREE(temp);
+ }
+ }
+
/*
* In dump_output_immediately mode, LYCookieSaveFile defaults to
* /dev/null, otherwise it defaults to LYCookieFile.
*/
-
- if (dump_output_immediately) {
- if (LYCookieSaveFile != NULL) {
- if (LYCookieSaveFile[0] == '~' && LYCookieSaveFile[1] == '/' &&
- LYCookieSaveFile[2] != '\0') {
- temp = NULL;
- StrAllocCopy(temp, LYCookieSaveFile + 2);
- StrAllocCopy(LYCookieSaveFile, wwwName(Home_Dir()));
- LYAddPathSep(&LYCookieSaveFile);
- StrAllocCat(LYCookieSaveFile, temp);
- FREE(temp);
- }
- } else {
+ if(dump_output_immediately) {
StrAllocCopy(LYCookieSaveFile, "/dev/null");
- }
} else {
- if (LYCookieSaveFile == NULL) {
+ if (LYCookieSaveFile == NULL)
StrAllocCopy(LYCookieSaveFile, LYCookieFile);
- }
}
#endif
--
YO-YO:
Something that is occasionally up but normally down.
(see also Computer).