From 3abad0ba89d9d01eb8ff7195d02cf3e0c461cb19 Mon Sep 17 00:00:00 2001 From: mongo Date: Fri, 10 Feb 2017 16:56:48 -0300 Subject: Fix bug that create duplicates in commandline history if the command recently typed was the latest used as well --- src/history.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/history.c') diff --git a/src/history.c b/src/history.c index 198bb46..8210250 100644 --- a/src/history.c +++ b/src/history.c @@ -153,7 +153,7 @@ void del_item_from_history(struct history * h, int pos) { // pos=0 first element, pos=-1 second element // returns 1 if moved, 0 otherwise. int move_item_from_history_by_str(struct history * h, wchar_t * item, int pos) { - if (h->len - 1 < -pos || ! pos || ! wcslen(item)) return 0; // Move the first element is disallowed + if (h->len - 1 < -pos || pos == 0 || ! wcslen(item)) return 0; // Move the first element is not allowed struct hlist * nl = h->list; struct hlist * n_ant = NULL; int i; -- cgit v1.2.3