cli: don't free the completion string when a setting name is unambiguous

If we found that setting name prefix is in fact unambiguous and return
the completion string for that setting we were freeing the string upon
the return. That looks like a typo.

Fixes "nmcli --complete-args add type wifi wifi."
                                           ^^^^ not ambiguous
This commit is contained in:
Lubomir Rintel 2016-06-22 09:29:03 +02:00
parent 67905347b2
commit 0172c1ed2d

View file

@ -3025,7 +3025,7 @@ get_valid_properties_string (const NameItem *array,
* that prefix is not ambiguous */
if (postfix) {
if (prop_name)
return g_string_free (str, TRUE);
return g_string_free (str, FALSE);
prop_name = prefix;
} else {
prop_name = iter->name;