]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpa_cli: Fix tab completion
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 28 Aug 2012 14:25:09 +0000 (17:25 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 28 Aug 2012 14:25:09 +0000 (17:25 +0300)
Commit b49039bda906461ccee57a41a9012d3df2c9e6bc redesigned tab
completion, but added the new call to completion functions into wrong
location. This needs to be done within the loop to find the correct
completion function.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

wpa_supplicant/wpa_cli.c

index b5c3b0f63fc235491b6b68212ecc8c33c1784d15..fb5772810d24dd0f9fb7c8438a72717ce57dd908 100644 (file)
@@ -2627,9 +2627,10 @@ static char ** wpa_cli_cmd_completion(const char *cmd, const char *str,
        int i;
 
        for (i = 0; wpa_cli_commands[i].cmd; i++) {
-               if (wpa_cli_commands[i].completion)
-                       return wpa_cli_commands[i].completion(str, pos);
                if (os_strcasecmp(wpa_cli_commands[i].cmd, cmd) == 0) {
+                       if (wpa_cli_commands[i].completion)
+                               return wpa_cli_commands[i].completion(str,
+                                                                     pos);
                        edit_clear_line();
                        printf("\r%s\n", wpa_cli_commands[i].usage);
                        edit_redraw();