diff options
author | andmarti1424 <andmarti@gmail.com> | 2017-02-26 21:17:17 -0300 |
---|---|---|
committer | andmarti1424 <andmarti@gmail.com> | 2017-02-26 21:17:17 -0300 |
commit | 7eae9c4a7cc570cf459da61dd63d7ae458b9699f (patch) | |
tree | c71110d30cbd440d90131577931f9ed5147b5ad7 /src/history.c | |
parent | cbc4f197d4acd7e04344d5e3d75bbf60a85e4103 (diff) |
Last item types could be written twice in history
Diffstat (limited to 'src/history.c')
-rw-r--r-- | src/history.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/history.c b/src/history.c index 8210250..552d2f4 100644 --- a/src/history.c +++ b/src/history.c @@ -155,6 +155,7 @@ void del_item_from_history(struct history * h, int pos) { int move_item_from_history_by_str(struct history * h, wchar_t * item, int pos) { if (h->len - 1 < -pos || pos == 0 || ! wcslen(item)) return 0; // Move the first element is not allowed struct hlist * nl = h->list; + if (nl != NULL && !wcscmp(item, nl->line)) return 1; struct hlist * n_ant = NULL; int i; |