summaryrefslogtreecommitdiff
path: root/tools/obexctl.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2017-09-18 12:03:27 +0300
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2017-09-20 15:28:44 +0300
commit913210973768140ddcc0bb2cb427e8c5e3fa6a1d (patch)
tree84a7f070f2f3646326f12c869677adb69463b56d /tools/obexctl.c
parent686dc41f0fb5fc465a8e6cc47680108cf1bcba3b (diff)
downloadbluez-913210973768140ddcc0bb2cb427e8c5e3fa6a1d.tar.gz
tools: Only add unique entries to readline history
Don't add duplicate commands to history this is similar to what HISTCONTROL=ignoredups does.
Diffstat (limited to 'tools/obexctl.c')
-rw-r--r--tools/obexctl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/obexctl.c b/tools/obexctl.c
index 46943d682..ece50f682 100644
--- a/tools/obexctl.c
+++ b/tools/obexctl.c
@@ -2081,7 +2081,8 @@ static void rl_handler(char *input)
if (!strlen(input))
goto done;
- add_history(input);
+ if (history_search(input, -1))
+ add_history(input);
if (wordexp(input, &w, WRDE_NOCMD))
goto done;