diff options
Diffstat (limited to 'Src')
-rw-r--r-- | Src/hist.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Src/hist.c b/Src/hist.c index f1bae14f4..6edd7b8cd 100644 --- a/Src/hist.c +++ b/Src/hist.c @@ -2246,10 +2246,12 @@ readhistfile(char *fn, int err, int readflags) if (!fn && !(fn = getsparam("HISTFILE"))) return; + if (stat(unmeta(fn), &sb) < 0 || + sb.st_size == 0) + return; if (readflags & HFILE_FAST) { - if (stat(unmeta(fn), &sb) < 0 - || (lasthist.fsiz == sb.st_size && lasthist.mtim == sb.st_mtime) - || lockhistfile(fn, 0)) + if ((lasthist.fsiz == sb.st_size && lasthist.mtim == sb.st_mtime) + || lockhistfile(fn, 0)) return; lasthist.fsiz = sb.st_size; lasthist.mtim = sb.st_mtime; |