From: Kevin McCarthy Date: Fri, 28 Jun 2019 19:57:24 +0000 (-0700) Subject: Don't read or save history if $history_file isn't set. X-Git-Tag: mutt-1-12-2-rel~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f3ec740d1a4d4829ade7fb4298b78b274c3772b1;p=mutt Don't read or save history if $history_file isn't set. --- 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)