Merge pull request #1 from CatsSky/master

fix history file open
This commit is contained in:
fenze 2022-05-14 17:29:55 +02:00 committed by GitHub
commit 9eae62683f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -113,18 +113,10 @@ void rose_load_changed_callback(WebKitWebView *webview,
const char *uri = webkit_web_view_get_uri(webview);
char *cookiefile = calloc(1, sizeof(char) * (strlen(options[CACHE]) + 32) + 1);
sprintf(cookiefile, "%s/history", options[CACHE]);
FILE *f = fopen(cookiefile, "r");
if (!f) {
fclose(f);
FILE *f = fopen(cookiefile, "w");
fclose(f);
} else {
fclose(f);
}
FILE *cookie = fopen(cookiefile, "a");
fprintf(f, "%s\n", uri);
fprintf(cookie, "%s\n", uri);
fclose(cookie);
free(cookiefile);
}