mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-05-30 15:56:36 +08:00
Simplify saved_command_line handling
There doesn't seem to be much point in trying to reuse this buffer. Prefer simplicity instead. (In case you're wondering whether this fixes an off-by-one: linelength is misnamed; it's really a size including terminating null char.) gdb/ChangeLog: 2016-03-09 Pedro Alves <palves@redhat.com> * event-top.c (command_line_handler): Use xfree + xstrdup instead of xrealloc + strcpy. * main.c (captured_main): Use xstrdup instead of xmalloc plus manual clear. * top.c (saved_command_line): Rewrite comment. (saved_command_line_size): Delete. (command_line_input): Use xfree + xstrdup instead of xrealloc + strcpy. * top.h (saved_command_line_size): Delete declaration.
This commit is contained in:
@ -506,8 +506,7 @@ captured_main (void *data)
|
||||
ndir = 0;
|
||||
|
||||
clear_quit_flag ();
|
||||
saved_command_line = (char *) xmalloc (saved_command_line_size);
|
||||
saved_command_line[0] = '\0';
|
||||
saved_command_line = (char *) xstrdup ("");
|
||||
instream = stdin;
|
||||
|
||||
#ifdef __MINGW32__
|
||||
|
Reference in New Issue
Block a user