aboutsummaryrefslogtreecommitdiff
path: root/gdb/event-top.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/event-top.c')
-rw-r--r--gdb/event-top.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/gdb/event-top.c b/gdb/event-top.c
index 8857235..f112c52 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -650,13 +650,8 @@ command_line_handler (char *rl)
/* Save into global buffer if appropriate. */
if (repeat)
{
- if (linelength > saved_command_line_size)
- {
- saved_command_line
- = (char *) xrealloc (saved_command_line, linelength);
- saved_command_line_size = linelength;
- }
- strcpy (saved_command_line, linebuffer);
+ xfree (saved_command_line);
+ saved_command_line = xstrdup (linebuffer);
if (!more_to_come)
{
command_handler (saved_command_line);