diff options
author | 2018-01-15 22:30:38 +0000 | |
---|---|---|
committer | 2018-01-15 22:30:38 +0000 | |
commit | e2f403d15ab190a455dd9d4efca30d7dfb7cc64f (patch) | |
tree | 713a675fbac812b93e4c7918b21f3671c715562d | |
parent | Switch the inteldrm(4) i2c code over to the Linux code base. This gives us (diff) | |
download | wireguard-openbsd-e2f403d15ab190a455dd9d4efca30d7dfb7cc64f.tar.xz wireguard-openbsd-e2f403d15ab190a455dd9d4efca30d7dfb7cc64f.zip |
Don't try to open HISTFILE if the variable is unset.
str_val returns null, not NULL, if the variable isn't set. The
erroneous check means that we later tried to open("").
ok millert@ tb@ anton@ benno@
-rw-r--r-- | bin/ksh/history.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/bin/ksh/history.c b/bin/ksh/history.c index 84ea5fdf263..67735c90964 100644 --- a/bin/ksh/history.c +++ b/bin/ksh/history.c @@ -1,4 +1,4 @@ -/* $OpenBSD: history.c,v 1.79 2018/01/15 14:58:05 jca Exp $ */ +/* $OpenBSD: history.c,v 1.80 2018/01/15 22:30:38 jca Exp $ */ /* * command history @@ -791,10 +791,9 @@ hist_init(Source *s) hist_source = s; - hname = str_val(global("HISTFILE")); - if (hname == NULL) + if (str_val(global("HISTFILE")) == null) return; - hname = str_save(hname, APERM); + hname = str_save(str_val(global("HISTFILE")), APERM); histfh = history_open(); if (histfh == NULL) return; |