+2016-04-12 Pedro Alves <palves@redhat.com>
+
+ * top.c (read_command_file): Inline command_loop here.
+ (command_loop): Delete.
+
2016-04-12 Pedro Alves <palves@redhat.com>
* top.c: Include "gdb_select.h".
cleanups = make_cleanup (do_restore_instream_cleanup, instream);
instream = stream;
- command_loop ();
+
+ /* Read commands from `instream' and execute them until end of file
+ or error reading instream. */
+
+ while (instream != NULL && !feof (instream))
+ {
+ char *command;
+
+ /* Get a command-line. This calls the readline package. */
+ command = command_line_input (NULL, 0, NULL);
+ if (command == NULL)
+ break;
+ command_handler (command);
+ }
+
do_cleanups (cleanups);
}
\f
return retval;
}
-/* Read commands from `instream' and execute them
- until end of file or error reading instream. */
-
-void
-command_loop (void)
-{
- while (instream && !feof (instream))
- {
- char *command;
-
- /* Get a command-line. This calls the readline package. */
- command = command_line_input (instream == stdin ?
- get_prompt () : (char *) NULL,
- instream == stdin, "prompt");
- if (command == NULL)
- return;
- command_handler (command);
- }
-}
\f
/* When nonzero, cause dont_repeat to do nothing. This should only be
set via prevent_dont_repeat. */