aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wpa_cli.c
diff options
context:
space:
mode:
authorMikael Kanstrup <mikael.kanstrup@sonymobile.com>2015-03-24 16:10:36 (GMT)
committerJouni Malinen <j@w1.fi>2015-03-26 20:36:12 (GMT)
commit94dc0e950d18a586ca40799584e75745dc52cebd (patch)
tree93190c4d64d6df34d98b94344b9b4fa90b3b9f3a /wpa_supplicant/wpa_cli.c
parentce591c74bff117ad428b342428e59b22fd9b140e (diff)
downloadhostap-94dc0e950d18a586ca40799584e75745dc52cebd.zip
hostap-94dc0e950d18a586ca40799584e75745dc52cebd.tar.gz
hostap-94dc0e950d18a586ca40799584e75745dc52cebd.tar.bz2
wpa_cli: Allow tab as alternative separator for cli_txt_list words
To be able to reuse the add/del word utility functions for lines containing tabs allow both space and tab as word separators. Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
Diffstat (limited to 'wpa_supplicant/wpa_cli.c')
-rw-r--r--wpa_supplicant/wpa_cli.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
index 27f10f1..4cdb138 100644
--- a/wpa_supplicant/wpa_cli.c
+++ b/wpa_supplicant/wpa_cli.c
@@ -174,6 +174,8 @@ static void cli_txt_list_del_word(struct dl_list *txt_list, const char *txt)
char *buf;
end = os_strchr(txt, ' ');
if (end == NULL)
+ end = os_strchr(txt, '\t');
+ if (end == NULL)
end = txt + os_strlen(txt);
buf = dup_binstr(txt, end - txt);
if (buf == NULL)
@@ -222,6 +224,8 @@ static int cli_txt_list_add_word(struct dl_list *txt_list, const char *txt)
int ret;
end = os_strchr(txt, ' ');
if (end == NULL)
+ end = os_strchr(txt, '\t');
+ if (end == NULL)
end = txt + os_strlen(txt);
buf = dup_binstr(txt, end - txt);
if (buf == NULL)