Parcourir la source

wpa_cli: Fix tab completion

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>
Jouni Malinen il y a 12 ans
Parent
commit
e4f6873cce
1 fichiers modifiés avec 3 ajouts et 2 suppressions
  1. 3 2
      wpa_supplicant/wpa_cli.c

+ 3 - 2
wpa_supplicant/wpa_cli.c

@@ -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();