* cli/cli-setshow.c (cmd_show_list): Check for "show" in the middle
authorDaniel Jacobowitz <drow@false.org>
Mon, 10 May 2004 18:17:25 +0000 (18:17 +0000)
committerDaniel Jacobowitz <drow@false.org>
Mon, 10 May 2004 18:17:25 +0000 (18:17 +0000)
of prefixes.  Don't print the prefix twice in the CLI.

gdb/ChangeLog
gdb/cli/cli-setshow.c

index af504aad0d4dacc3467f9094c5e216d8b40648de..d5b1337278f3198b254ad1a9dda54f473d59e147 100644 (file)
@@ -1,3 +1,8 @@
+2004-05-10  Daniel Jacobowitz  <drow@mvista.com>
+
+       * cli/cli-setshow.c (cmd_show_list): Check for "show" in the middle
+       of prefixes.  Don't print the prefix twice in the CLI.
+
 2004-05-10  Jim Blandy  <jimb@redhat.com>
 
        * ppc-tdep.h (struct gdbarch_tdep): Change definition of
index 37b289dd8ab58eacc57fbece3797d96aa49f14c9..cf87cf6161bbd13e5e6d0786c4d311dcd42161c8 100644 (file)
@@ -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);
        }