We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ee66aab commit 1ff86c4Copy full SHA for 1ff86c4
history.c
@@ -90,8 +90,13 @@ saveHistory(Hist *hist, size_t size)
90
return;
91
92
histf = rcFile(HISTORY_FILE);
93
- if (stat(histf, &st) == -1)
94
- goto fail;
+ if (stat(histf, &st) == -1) {
+ FILE *touchHist = fopen(histf, "w");
95
+ if (touchHist == NULL)
96
+ goto fail;
97
+ if (fclose(touchHist) != 0)
98
99
+ }
100
if (hist->mtime != (long long)st.st_mtime) {
101
fhist = newHist();
102
if (loadHistory(fhist) || mergeHistory(fhist, hist))
0 commit comments