This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[obv] Handle var_string_noescape and var_optional_filename together.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]