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>
This commit is contained in:
parent
ce591c74bf
commit
94dc0e950d
1 changed files with 4 additions and 0 deletions
|
@ -173,6 +173,8 @@ static void cli_txt_list_del_word(struct dl_list *txt_list, const char *txt)
|
||||||
const char *end;
|
const char *end;
|
||||||
char *buf;
|
char *buf;
|
||||||
end = os_strchr(txt, ' ');
|
end = os_strchr(txt, ' ');
|
||||||
|
if (end == NULL)
|
||||||
|
end = os_strchr(txt, '\t');
|
||||||
if (end == NULL)
|
if (end == NULL)
|
||||||
end = txt + os_strlen(txt);
|
end = txt + os_strlen(txt);
|
||||||
buf = dup_binstr(txt, end - txt);
|
buf = dup_binstr(txt, end - txt);
|
||||||
|
@ -221,6 +223,8 @@ static int cli_txt_list_add_word(struct dl_list *txt_list, const char *txt)
|
||||||
char *buf;
|
char *buf;
|
||||||
int ret;
|
int ret;
|
||||||
end = os_strchr(txt, ' ');
|
end = os_strchr(txt, ' ');
|
||||||
|
if (end == NULL)
|
||||||
|
end = os_strchr(txt, '\t');
|
||||||
if (end == NULL)
|
if (end == NULL)
|
||||||
end = txt + os_strlen(txt);
|
end = txt + os_strlen(txt);
|
||||||
buf = dup_binstr(txt, end - txt);
|
buf = dup_binstr(txt, end - txt);
|
||||||
|
|
Loading…
Reference in a new issue