diff mbox

[1/5] wpa_cli: Allow tab as alternative separator for cli_txt_list words

Message ID 1427213440-31040-1-git-send-email-mikael.kanstrup@sonymobile.com
State Accepted
Headers show

Commit Message

Mikael Kanstrup March 24, 2015, 4:10 p.m. UTC
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@sonymobile.com>
---
 wpa_supplicant/wpa_cli.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Jouni Malinen March 26, 2015, 9:21 p.m. UTC | #1
On Tue, Mar 24, 2015 at 05:10:36PM +0100, Mikael Kanstrup wrote:
> To be able to reuse the add/del word utility functions for lines containing
> tabs allow both whitespace and tab as word separators.

Thanks, applied all five patches with some cleanup.
Mikael Kanstrup March 27, 2015, 9:37 a.m. UTC | #2
Thanks! I unfortunately found a silly bug. Sorry for that. If SSID
contains white space character the completion routine does not work as
expected. I'll upload a fix for that in a separate mail.

/Mikael

2015-03-26 22:21 GMT+01:00 Jouni Malinen <j@w1.fi>:
> On Tue, Mar 24, 2015 at 05:10:36PM +0100, Mikael Kanstrup wrote:
>> To be able to reuse the add/del word utility functions for lines containing
>> tabs allow both whitespace and tab as word separators.
>
> Thanks, applied all five patches with some cleanup.
>
> --
> Jouni Malinen                                            PGP id EFC895FA
> _______________________________________________
> HostAP mailing list
> HostAP@lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap
diff mbox

Patch

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)