From b0e808637dd91e51e79cac172cb35079d63f966a Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 16 Nov 2011 11:30:03 +0000 Subject: Don't create a history file called -... doh. Pointed out by jmc. --- usr.bin/less/cmdbuf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.bin/less/cmdbuf.c b/usr.bin/less/cmdbuf.c index 9a56979b4dd..93fbf113265 100644 --- a/usr.bin/less/cmdbuf.c +++ b/usr.bin/less/cmdbuf.c @@ -1352,7 +1352,9 @@ histfile_name() return (save(name)); } - /* Otherwise, file is in $HOME. */ + /* Otherwise, file is in $HOME if enabled. */ + if (strcmp (LESSHISTFILE, "-") == 0) + return (NULL); home = lgetenv("HOME"); if (home == NULL || *home == '\0') { -- cgit v1.2.3