Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [obv] Handle var_string_noescape and var_optional_filename together.
@ 2012-07-18 12:41 Yao Qi
  2012-07-18 13:57 ` Jan Kratochvil
  0 siblings, 1 reply; 6+ messages in thread
From: Yao Qi @ 2012-07-18 12:41 UTC (permalink / raw)
  To: gdb-patches

Hi,
I notice that the code in case var_string_noescape and var_optional_filename
are exactly the same, so this patch is to combine them together.  I'll commit
it in two days.

gdb:

2012-07-18  Yao Qi  <yao@codesourcery.com>

	* cli/cli-setshow.c (do_setshow_command): Handle case 'var_string_noescape'
	and 'var_optional_filename' together.
---
 gdb/cli/cli-setshow.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c
index f46d15a..0f854e5 100644
--- a/gdb/cli/cli-setshow.c
+++ b/gdb/cli/cli-setshow.c
@@ -190,12 +190,6 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
 	  }
 	  break;
 	case var_string_noescape:
-	  if (arg == NULL)
-	    arg = "";
-	  if (*(char **) c->var != NULL)
-	    xfree (*(char **) c->var);
-	  *(char **) c->var = xstrdup (arg);
-	  break;
 	case var_optional_filename:
 	  if (arg == NULL)
 	    arg = "";
-- 
1.7.7.6


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-07-19  7:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-18 12:41 [obv] Handle var_string_noescape and var_optional_filename together Yao Qi
2012-07-18 13:57 ` Jan Kratochvil
2012-07-18 14:59   ` Yao Qi
2012-07-18 15:26     ` Jan Kratochvil
2012-07-19  7:54       ` [committed]:[obv] " Yao Qi
2012-07-19  7:58         ` Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox