From 76186d652f5bea2594d8ca07afdc3e823110a176 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 21 Aug 2013 10:40:01 +0200 Subject: [PATCH] nmcli: strip whitespace when reading property name in edit mode When reading the property name in edit mode, any white space should be striped from the entered value. Especially, because tab completion will add a trailing whitespace. Example: $ nmcli connection edit Enter connection type: ethernet nmcli> goto connection nmcli connection> describe Property name? u The will complete 'u' to 'uuid '. This whitespace should be allowed and striped. Signed-off-by: Thomas Haller --- cli/src/connections.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/src/connections.c b/cli/src/connections.c index 5964c2ae5f..d67bcd7042 100644 --- a/cli/src/connections.c +++ b/cli/src/connections.c @@ -4553,7 +4553,7 @@ ask_check_property (const char *arg, if (!arg) { printf (_("Available properties: %s\n"), valid_props_str); - prop_name_user = readline_x (EDITOR_PROMPT_PROPERTY); + prop_name_user = g_strstrip (readline_x (EDITOR_PROMPT_PROPERTY)); } else prop_name_user = g_strdup (arg);