diff options
author | mongo <mongo@iomega> | 2017-02-10 16:56:48 -0300 |
---|---|---|
committer | mongo <mongo@iomega> | 2017-02-10 16:56:48 -0300 |
commit | 3abad0ba89d9d01eb8ff7195d02cf3e0c461cb19 (patch) | |
tree | a8adee876bdd8bc4f5b21ff75e3d615bb77b2e2a /src/history.c | |
parent | d7b3561968aa52b3674eb187d25e5979d4e94f7d (diff) |
Fix bug that create duplicates in commandline history if the command recently typed was the latest used as well
Diffstat (limited to 'src/history.c')
-rw-r--r-- | src/history.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |