diff options
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/cli/cli-cmds.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 51e946f..86f522d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2019-05-21 Tom de Vries <tdevries@suse.de> + + PR cli/24587 + * cli/cli-cmds.c (complete_command): Fix use of unitialized variable. + 2019-05-18 Andrew Burgess <andrew.burgess@embecosm.com> PR gdb/18644: diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index 332078b..daf409a 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -248,10 +248,10 @@ complete_command (const char *arg, int from_tty) completion_result result = complete (arg, &word, "e_char); - std::string arg_prefix (arg, word - arg); - if (result.number_matches != 0) { + std::string arg_prefix (arg, word - arg); + if (result.number_matches == 1) printf_unfiltered ("%s%s\n", arg_prefix.c_str (), result.match_list[0]); else |