summaryrefslogtreecommitdiffstats
path: root/bin/sh/histedit.c
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2010-08-01 16:37:51 +0000
committerjilles <jilles@FreeBSD.org>2010-08-01 16:37:51 +0000
commit21076809adb31a3dc9191e7c9075d88ec13ad53c (patch)
treea4efb37a0d6ab70bbfbc12cebe50ec625cb23af7 /bin/sh/histedit.c
parent3c2469212a3c454f067ae11dbbdd9af10d56b851 (diff)
downloadFreeBSD-src-21076809adb31a3dc9191e7c9075d88ec13ad53c.zip
FreeBSD-src-21076809adb31a3dc9191e7c9075d88ec13ad53c.tar.gz
sh: Do not enter consecutive duplicates into the history.
This simply sets a flag in libedit. It has a shortcoming in that it does not apply to multi-line commands. Note that a configuration option for this is not going to happen, but always having this seems better than not having it. NetBSD has done the same. PR: bin/54683 Obtained from: NetBSD MFC after: 1 month
Diffstat (limited to 'bin/sh/histedit.c')
-rw-r--r--bin/sh/histedit.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/bin/sh/histedit.c b/bin/sh/histedit.c
index b76d73d..d92a7a3 100644
--- a/bin/sh/histedit.c
+++ b/bin/sh/histedit.c
@@ -168,6 +168,7 @@ sethistsize(hs)
(histsize = atoi(hs)) < 0)
histsize = 100;
history(hist, &he, H_SETSIZE, histsize);
+ history(hist, &he, H_SETUNIQUE, 1);
}
}
OpenPOWER on IntegriCloud