3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 21:22:37 +01:00

client: Fix display of the quoted params

This commit is contained in:
Tim Kourt 2018-11-09 13:43:15 -08:00 committed by Denis Kenzior
parent 5afe4576a1
commit a7c28c4977

View File

@ -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);