mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-22 13:02:44 +01:00
client: Fix display of the quoted params
This commit is contained in:
parent
5afe4576a1
commit
a7c28c4977
@ -185,8 +185,23 @@ void display_refresh_set_cmd(const char *family, const char *entity,
|
||||
L_AUTO_FREE_VAR(char *, args);
|
||||
char *prompt;
|
||||
|
||||
for (i = 0; i < argc; i++)
|
||||
l_string_append_printf(buf, "'%s' ", argv[i]);
|
||||
for (i = 0; i < argc; i++) {
|
||||
bool needs_quotes = false;
|
||||
char *p = argv[i];
|
||||
|
||||
for (p = argv[i]; *p != '\0'; p++) {
|
||||
if (*p != ' ')
|
||||
continue;
|
||||
|
||||
needs_quotes = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (needs_quotes)
|
||||
l_string_append_printf(buf, "\"%s\" ", argv[i]);
|
||||
else
|
||||
l_string_append_printf(buf, "%s ", argv[i]);
|
||||
}
|
||||
|
||||
args = l_string_unwrap(buf);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user