summaryrefslogtreecommitdiff
path: root/usr.bin/less
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2011-11-16 11:30:03 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2011-11-16 11:30:03 +0000
commitb0e808637dd91e51e79cac172cb35079d63f966a (patch)
tree4b71201f28c8c2c00f7c8cda8694ced6609a690b /usr.bin/less
parentfeee35baa6a575f5baa2fa17578ab03e53b4f877 (diff)
Don't create a history file called -... doh. Pointed out by jmc.
Diffstat (limited to 'usr.bin/less')
-rw-r--r--usr.bin/less/cmdbuf.c4
1 files changed, 3 insertions, 1 deletions
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')
{