aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/completer.c7
2 files changed, 12 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2ab3615..a32c606 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2019-05-30 Jan Vrany <jan.vrany@fit.cvut.cz>
+
+ PR cli/24587
+ * completer.c (complete): Initialize variable word.
+
2019-05-29 Sergio Durigan Junior <sergiodj@redhat.com>
Ref.: https://bugzilla.redhat.com/show_bug.cgi?id=1708192
diff --git a/gdb/completer.c b/gdb/completer.c
index cc2f80b..24c8446 100644
--- a/gdb/completer.c
+++ b/gdb/completer.c
@@ -1622,6 +1622,13 @@ complete (const char *line, char const **word, int *quote_char)
completion_tracker tracker_handle_completions;
completion_tracker *tracker;
+ /* The WORD should be set to the end of word to complete. We initialize
+ to the completion point which is assumed to be at the end of LINE.
+ This leaves WORD to be initialized to a sensible value in cases
+ completion_find_completion_word() fails i.e., throws an exception.
+ See bug 24587. */
+ *word = line + strlen (line);
+
try
{
*word = completion_find_completion_word (tracker_handle_brkchars,