diff --git a/client/dbus-proxy.c b/client/dbus-proxy.c index 443e66ca..e7b18835 100644 --- a/client/dbus-proxy.c +++ b/client/dbus-proxy.c @@ -2,7 +2,7 @@ * * Wireless daemon for Linux * - * Copyright (C) 2017 Intel Corporation. All rights reserved. + * Copyright (C) 2017-2019 Intel Corporation. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -140,6 +140,20 @@ static void interface_update_properties(struct proxy_interface *proxy, proxy_interface_property_update(proxy, name, NULL); } +static char *strdup_quoted_for_spaces(const char *str) +{ + const char *p; + + for (p = str; *p; p++) { + if (*p != ' ') + continue; + + return l_strdup_printf("\"%s\"", str); + } + + return l_strdup(str); +} + char *proxy_property_str_completion(const struct proxy_interface_type *type, proxy_property_match_func_t function, const char *property_name, @@ -177,7 +191,7 @@ char *proxy_property_str_completion(const struct proxy_interface_type *type, if (!str) goto done; - return l_strdup(str); + return strdup_quoted_for_spaces(str); } done: l_queue_destroy(match, NULL); diff --git a/client/display.c b/client/display.c index 76ebc182..94b2bdec 100644 --- a/client/display.c +++ b/client/display.c @@ -605,6 +605,7 @@ void display_init(void) rl_attempted_completion_function = command_completion; rl_completion_display_matches_hook = display_completion_matches; + rl_completer_quote_characters = "\""; rl_erase_empty_line = 1; rl_callback_handler_install("Waiting for IWD to appear...", readline_callback);