1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[cookies] const

This commit is contained in:
Witold Filipczyk 2022-01-31 15:54:55 +01:00
parent a437ff883c
commit cac27201d4

View File

@ -695,12 +695,13 @@ load_cookies(void) {
* save_cookies may write. 6 is choosen after the fprintf(..) call * save_cookies may write. 6 is choosen after the fprintf(..) call
* in save_cookies(). --Zas */ * in save_cookies(). --Zas */
char in_buffer[6 * MAX_STR_LEN]; char in_buffer[6 * MAX_STR_LEN];
char *cookfile = COOKIES_FILENAME; const char *cookfile_orig = COOKIES_FILENAME;
char *cookfile;
FILE *fp; FILE *fp;
time_t now; time_t now;
if (elinks_home) { if (elinks_home) {
cookfile = straconcat(elinks_home, cookfile, cookfile = straconcat(elinks_home, cookfile_orig,
(char *) NULL); (char *) NULL);
if (!cookfile) return; if (!cookfile) return;
} }
@ -711,8 +712,12 @@ load_cookies(void) {
done_cookies(&cookies_module); done_cookies(&cookies_module);
cookies_nosave = 0; cookies_nosave = 0;
fp = fopen(cookfile, "rb"); if (elinks_home) {
if (elinks_home) mem_free(cookfile); fp = fopen(cookfile, "rb");
mem_free(cookfile);
} else {
fp = fopen(cookfile_orig, "rb");
}
if (!fp) return; if (!fp) return;
/* XXX: We don't want to overwrite the cookies file /* XXX: We don't want to overwrite the cookies file