From 37fc812e64d75bfe01a22d7184d8bf96e77ea361 Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Mon, 10 May 2004 18:17:25 +0000 Subject: * cli/cli-setshow.c (cmd_show_list): Check for "show" in the middle of prefixes. Don't print the prefix twice in the CLI. --- gdb/cli/cli-setshow.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gdb/cli/cli-setshow.c') diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c index 37b289d..cf87cf6 100644 --- a/gdb/cli/cli-setshow.c +++ b/gdb/cli/cli-setshow.c @@ -364,8 +364,10 @@ cmd_show_list (struct cmd_list_element *list, int from_tty, char *prefix) { struct cleanup *optionlist_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "optionlist"); - ui_out_field_string (uiout, "prefix", list->prefixname + 5); - cmd_show_list (*list->prefixlist, from_tty, list->prefixname + 5); + char *new_prefix = strstr (list->prefixname, "show ") + 5; + if (ui_out_is_mi_like_p (uiout)) + ui_out_field_string (uiout, "prefix", new_prefix); + cmd_show_list (*list->prefixlist, from_tty, new_prefix); /* Close the tuple. */ do_cleanups (optionlist_chain); } -- cgit v1.1