Conversation
297eb5f to
1ff86c4
Compare
|
On Sun, Jul 30, 2023 at 05:53:47AM -0700, Cihan Demirci wrote:
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.
Oops... :-)
Thanks for this fix!
Two remarks:
1. The indentation is off.
2. We can simplify this:
```
--- a/history.c
+++ b/history.c
@@ -90,9 +90,7 @@ saveHistory(Hist *hist, size_t size)
return;
histf = rcFile(HISTORY_FILE);
- if (stat(histf, &st) == -1)
- goto fail;
- if (hist->mtime != (long long)st.st_mtime) {
+ if (!stat(histf, &st) && hist->mtime != (long long)st.st_mtime) {
fhist = newHist();
if (loadHistory(fhist) || mergeHistory(fhist, hist))
disp_err_message("Can't merge history", FALSE);
```
|
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.
1ff86c4 to
855e956
Compare
I see, instead of explicitly creating an empty history, this leverages the I hope the indentation issue went away since this patch only adds one line now (and removes three). |
|
LGTM, Thanks!
|
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.