From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28342 invoked by alias); 18 Jul 2012 12:41:13 -0000 Received: (qmail 28274 invoked by uid 22791); 18 Jul 2012 12:41:09 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,DATE_IN_FUTURE_03_06,KHOP_RCVD_UNTRUST,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 18 Jul 2012 12:40:56 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1SrTYm-0004VS-3e from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Wed, 18 Jul 2012 05:40:56 -0700 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 18 Jul 2012 05:40:55 -0700 Received: from qiyao.dyndns.org.dyndns.org (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.1.289.1; Wed, 18 Jul 2012 05:40:54 -0700 From: Yao Qi To: Subject: [obv] Handle var_string_noescape and var_optional_filename together. Date: Wed, 18 Jul 2012 12:41:00 -0000 Message-ID: <1342636814-1674-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-07/txt/msg00258.txt.bz2 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 * 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