aboutsummaryrefslogtreecommitdiff
path: root/gdb/top.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/top.c')
-rw-r--r--gdb/top.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gdb/top.c b/gdb/top.c
index be736b0..c5fc94f 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -730,7 +730,7 @@ dont_repeat (void)
/* See command.h */
-void
+const char *
repeat_previous ()
{
/* Do not repeat this command, as this command is a repeating command. */
@@ -740,6 +740,11 @@ repeat_previous ()
so swap it with previous_saved_command_line. */
std::swap (previous_saved_command_line, saved_command_line);
std::swap (previous_repeat_arguments, repeat_arguments);
+
+ const char *prev = skip_spaces (get_saved_command_line ());
+ if (*prev == '\0')
+ error (_("No previous command to relaunch"));
+ return prev;
}
/* See command.h. */