[PATCH 1/5] wpa_cli: Allow tab as alternative separator for cli_txt_list words
Mikael Kanstrup
mikael.kanstrup
Tue Mar 24 09:10:36 PDT 2015
To be able to reuse the add/del word utility functions for lines containing
tabs allow both whitespace and tab as word separators.
Signed-off-by: Mikael Kanstrup <mikael.kanstrup at sonymobile.com>
---
wpa_supplicant/wpa_cli.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
index 2b40bbf..73fc592 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)
--
1.8.2.2
More information about the Hostap
mailing list