From: Jouni Malinen Date: Sun, 21 Nov 2010 09:49:36 +0000 (+0200) Subject: edit: Fix history prev selection X-Git-Tag: hostap-1-bp~769 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=19ec1f262e67fe7094365d53ee177f900afdaad5;p=thirdparty%2Fhostap.git edit: Fix history prev selection --- diff --git a/src/utils/edit.c b/src/utils/edit.c index 96cf736fa..ce220e59b 100644 --- a/src/utils/edit.c +++ b/src/utils/edit.c @@ -217,9 +217,7 @@ static void history_use(void) static void history_prev(void) { - if (history_curr == NULL || - history_curr == - dl_list_last(&history_list, struct edit_history, list)) + if (history_curr == NULL) return; if (history_curr == @@ -228,9 +226,14 @@ static void history_prev(void) history_add(cmdbuf); } + history_use(); + + if (history_curr == + dl_list_last(&history_list, struct edit_history, list)) + return; + history_curr = dl_list_entry(history_curr->list.next, struct edit_history, list); - history_use(); }