summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2019-06-28 12:57:24 -0700
committerKevin McCarthy <kevin@8t8.us>2019-06-28 12:57:24 -0700
commitf3ec740d1a4d4829ade7fb4298b78b274c3772b1 (patch)
treedc2b59c7c6d5934c8ce22b20d52d7692b53c1d1d
parent840b813fa27fafa7fe43e41e227a3331156c0d9b (diff)
Don't read or save history if $history_file isn't set.
-rw-r--r--history.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/history.c b/history.c
index f594746c..48565fdd 100644
--- a/history.c
+++ b/history.c
@@ -114,6 +114,9 @@ void mutt_read_histfile (void)
char *linebuf = NULL, *p;
size_t buflen;
+ if (!HistFile)
+ return;
+
if ((f = fopen (HistFile, "r")) == NULL)
return;
@@ -401,7 +404,7 @@ void mutt_history_add (history_class_t hclass, const char *s, int save)
{
if (option (OPTHISTREMOVEDUPS))
remove_history_dups (hclass, s);
- if (save && SaveHist)
+ if (save && SaveHist && HistFile)
save_history (hclass, s);
mutt_str_replace (&h->hist[h->last++], s);
if (h->last > HistSize)