Skip to content

Commit 855e956

Browse files
committed
create history file if it doesn't exist
When history is enabled but there is no history file, w3m logs an error message. Change that behavior to create a history file if it doesn't exists.
1 parent ee66aab commit 855e956

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

history.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,7 @@ saveHistory(Hist *hist, size_t size)
9090
return;
9191

9292
histf = rcFile(HISTORY_FILE);
93-
if (stat(histf, &st) == -1)
94-
goto fail;
95-
if (hist->mtime != (long long)st.st_mtime) {
93+
if (!stat(histf, &st) && hist->mtime != (long long)st.st_mtime) {
9694
fhist = newHist();
9795
if (loadHistory(fhist) || mergeHistory(fhist, hist))
9896
disp_err_message("Can't merge history", FALSE);

0 commit comments

Comments
 (0)