]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpa_cli: Allow tab as alternative separator for cli_txt_list words
authorMikael Kanstrup <mikael.kanstrup@sonymobile.com>
Tue, 24 Mar 2015 16:10:36 +0000 (17:10 +0100)
committerJouni Malinen <j@w1.fi>
Thu, 26 Mar 2015 20:36:12 +0000 (22:36 +0200)
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>
wpa_supplicant/wpa_cli.c

index 27f10f1c6831044d5f56d282b990963eeb016d03..4cdb1383cc8db0bc6059fa62dac17d80deaba541 100644 (file)
@@ -173,6 +173,8 @@ static void cli_txt_list_del_word(struct dl_list *txt_list, const char *txt)
        const char *end;
        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);
@@ -221,6 +223,8 @@ static int cli_txt_list_add_word(struct dl_list *txt_list, const char *txt)
        char *buf;
        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);