Merge history file if it was modified after start

w3m reads the history file on startup and writes it on exit. That means
if you open multiple instances of w3m, the history file will contain the
history of the last instance closed. All other history changes are lost.

Check if the modification time of the history file has changed before
writing. If it has changed read the history file from the disk into a
new history. Push the entries that are in the current history but not in
the history file into the new history and write the new history to disk.
This commit is contained in:
Rene Kita
2022-12-25 15:33:33 +01:00
parent e0c9a02784
commit c77029570d
2 changed files with 36 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ typedef struct {
HistList *list;
HistItem *current;
Hash_sv *hash;
long long mtime;
} Hist;
extern Hist *newHist(void);