aboutsummaryrefslogtreecommitdiff
path: root/gdb/top.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/top.c')
-rw-r--r--gdb/top.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gdb/top.c b/gdb/top.c
index a83d16b..2eb68fd 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -653,10 +653,14 @@ execute_command (const char *p, int from_tty)
that can be followed by its args), report the list of
subcommands. */
{
+ std::string prefixname = c->prefixname ();
+ std::string prefixname_no_space
+ = prefixname.substr (0, prefixname.length () - 1);
printf_unfiltered
- ("\"%.*s\" must be followed by the name of a subcommand.\n",
- (int) strlen (c->prefixname) - 1, c->prefixname);
- help_list (*c->prefixlist, c->prefixname, all_commands, gdb_stdout);
+ ("\"%s\" must be followed by the name of a subcommand.\n",
+ prefixname_no_space.c_str ());
+ help_list (*c->prefixlist, prefixname.c_str (), all_commands,
+ gdb_stdout);
}
else if (c->type == set_cmd)
do_set_command (arg, from_tty, c);