aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wpa_cli.c
diff options
context:
space:
mode:
authorMikael Kanstrup <mikael.kanstrup@sonymobile.com>2015-03-27 10:03:28 (GMT)
committerJouni Malinen <j@w1.fi>2015-03-27 13:31:38 (GMT)
commit9ccc10f56e60217ef398db256c35206d663fc927 (patch)
tree52badf0305a611d512b2f2bb277948bb3cb434f8 /wpa_supplicant/wpa_cli.c
parent5a997b2f79f180b2b3aa12030128b2984a7bb664 (diff)
downloadhostap-9ccc10f56e60217ef398db256c35206d663fc927.zip
hostap-9ccc10f56e60217ef398db256c35206d663fc927.tar.gz
hostap-9ccc10f56e60217ef398db256c35206d663fc927.tar.bz2
wpa_cli: Use tab as only word separator for networks
White space is a valid SSID character so completion routine for networks should only use tab as word separator. Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
Diffstat (limited to 'wpa_supplicant/wpa_cli.c')
-rw-r--r--wpa_supplicant/wpa_cli.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
index 5df7c48..1a4579e 100644
--- a/wpa_supplicant/wpa_cli.c
+++ b/wpa_supplicant/wpa_cli.c
@@ -170,13 +170,12 @@ static void cli_txt_list_del_addr(struct dl_list *txt_list, const char *txt)
#ifdef CONFIG_P2P
-static void cli_txt_list_del_word(struct dl_list *txt_list, const char *txt)
+static void cli_txt_list_del_word(struct dl_list *txt_list, const char *txt,
+ int separator)
{
const char *end;
char *buf;
- end = os_strchr(txt, ' ');
- if (end == NULL)
- end = os_strchr(txt, '\t');
+ end = os_strchr(txt, separator);
if (end == NULL)
end = txt + os_strlen(txt);
buf = dup_binstr(txt, end - txt);
@@ -220,14 +219,13 @@ static int cli_txt_list_add_addr(struct dl_list *txt_list, const char *txt)
#endif /* CONFIG_P2P */
-static int cli_txt_list_add_word(struct dl_list *txt_list, const char *txt)
+static int cli_txt_list_add_word(struct dl_list *txt_list, const char *txt,
+ int separator)
{
const char *end;
char *buf;
int ret;
- end = os_strchr(txt, ' ');
- if (end == NULL)
- end = os_strchr(txt, '\t');
+ end = os_strchr(txt, separator);
if (end == NULL)
end = txt + os_strlen(txt);
buf = dup_binstr(txt, end - txt);
@@ -3752,7 +3750,7 @@ static void cli_event(const char *str)
s = os_strchr(start, ' ');
if (s == NULL)
return;
- cli_txt_list_add_word(&p2p_groups, s + 1);
+ cli_txt_list_add_word(&p2p_groups, s + 1, ' ');
return;
}
@@ -3760,7 +3758,7 @@ static void cli_event(const char *str)
s = os_strchr(start, ' ');
if (s == NULL)
return;
- cli_txt_list_del_word(&p2p_groups, s + 1);
+ cli_txt_list_del_word(&p2p_groups, s + 1, ' ');
return;
}
#endif /* CONFIG_P2P */
@@ -4031,7 +4029,7 @@ static void update_networks(struct wpa_ctrl *ctrl)
break;
*end = '\0';
if (!header)
- cli_txt_list_add_word(&networks, pos);
+ cli_txt_list_add_word(&networks, pos, '\t');
header = 0;
pos = end + 1;
}