aboutsummaryrefslogtreecommitdiff
path: root/gdb/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/main.c')
-rw-r--r--gdb/main.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gdb/main.c b/gdb/main.c
index 96b6cde..38771da 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -1987,8 +1987,16 @@ complete_command (arg, from_tty)
dont_repeat ();
- strcpy (rl_line_buffer, arg);
- rl_point = strlen (arg);
+ if (arg == NULL)
+ {
+ rl_line_buffer[0] = '\0';
+ rl_point = 0;
+ }
+ else
+ {
+ strcpy (rl_line_buffer, arg);
+ rl_point = strlen (arg);
+ }
for (completion = symbol_completion_function (rl_line_buffer, i = 0);
completion;