From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6357 invoked by alias); 22 May 2013 12:04:34 -0000 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 Received: (qmail 6347 invoked by uid 89); 22 May 2013 12:04:34 -0000 X-Spam-SWARE-Status: No, score=-4.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL autolearn=ham version=3.3.1 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 22 May 2013 12:04:33 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1Uf7mS-00065w-1I from Muhammad_Bilal@mentor.com ; Wed, 22 May 2013 05:04:32 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 22 May 2013 05:04:32 -0700 Received: from [137.202.157.37] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server (TLS) id 14.2.247.3; Wed, 22 May 2013 13:04:29 +0100 Message-ID: <519CB44D.5010109@codesourcery.com> Date: Wed, 22 May 2013 12:04:00 -0000 From: mbilal User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: CC: , Subject: Re: [PATCH 1/7] PR gdb/15224 "set history filename" to by immediately converted to absolute path References: <51877A32.1030503@codesourcery.com> <51877A99.4060503@codesourcery.com> <5188AA15.5010904@codesourcery.com> <5188F70A.1030908@codesourcery.com> <518A0B2E.7000706@codesourcery.com> <519366E2.90105@codesourcery.com> In-Reply-To: <519366E2.90105@codesourcery.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2013-05/txt/msg00828.txt.bz2 On 05/15/2013 03:43 PM, mbilal wrote: > Hi, > Please find attached updated patch. > > On Wednesday, May 08, 2013 8:47 PM Pedro wrote: > > >Missing space before NULL. That's a lot of casting. We can just refer > >to history_filename directly. It'd be very good to have a comment > here with the > >rationale for this -- there's one in init_history we can reuse. So: > > Fixed > > On Wednesday, May 08, 2013 10:25 PM Pedro wrote: > >In addition to my previous comments, I realized that this will do the > >wrong thing with "set history filename ~/foo". Best use tilde_expand > >and gdb_realpath > > 'set history filename ~/foo' is working because following code is doing > same as you described . I have also attached test case for this. > > if (arg != NULL) > { > /* Clear trailing whitespace of filename. */ > char *ptr = arg + strlen (arg) - 1; > > while (ptr >= arg && (*ptr == ' ' || *ptr == '\t')) > ptr--; > *(ptr + 1) = '\0'; > > val = tilde_expand (arg); > } > else > val = xstrdup (""); > > if (*(char **) c->var == NULL > || strcmp (*(char **) c->var, val) != 0) > { > xfree (*(char **) c->var); > *(char **) c->var = val; > > option_changed = 1; > > > > > 2013-05-15 Muhammad Bilal > > PR gdb/15224 > * top.c (set_history_filename): New function. > > > > 2013-05-15 Muhammad Bilal > > PR gdb/15224 > * gdb.base/setshow.exp: Test 'set history filename' relative > path. > > > > > > Thanks, > -Bilal > > > ping?