]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
edit: Fix history prev selection
authorJouni Malinen <j@w1.fi>
Sun, 21 Nov 2010 09:49:36 +0000 (11:49 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 21 Nov 2010 09:49:36 +0000 (11:49 +0200)
src/utils/edit.c

index 96cf736fae350f3f871125ca75a6de7f64d53a4c..ce220e59b9cf2e5f5b7ff4081163a7aab36c76bf 100644 (file)
@@ -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();
 }