From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24067 invoked by alias); 24 May 2012 15:31:12 -0000 Received: (qmail 24056 invoked by uid 22791); 24 May 2012 15:31:11 -0000 X-SWARE-Spam-Status: No, hits=-7.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,TW_CP,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 24 May 2012 15:30:57 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4OFUukJ013188 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 24 May 2012 11:30:56 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q4OFUsqR010079; Thu, 24 May 2012 11:30:55 -0400 Message-ID: <4FBE542E.8020703@redhat.com> Date: Thu, 24 May 2012 15:31:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: Thiago Jung Bauermann CC: gdb-patches ml Subject: Re: [patch] Expand tildes in solib-search-path entries. References: <1337710624.19373.9.camel@hactar> In-Reply-To: <1337710624.19373.9.camel@hactar> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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-05/txt/msg00929.txt.bz2 On 05/22/2012 07:17 PM, Thiago Jung Bauermann wrote: > diff --git a/gdb/source.c b/gdb/source.c > index 27c5b0e..af68ebd 100644 > --- a/gdb/source.c > +++ b/gdb/source.c > @@ -771,8 +771,28 @@ openp (const char *path, int opts, const char *string, > } > else > { > - /* Normal file name in path -- just use it. */ > - strcpy (filename, dir); > + /* See whether we need to expand the tilde. */ > + if (strchr(dir, '~')) Seem to me this could be an "else if" above the "else" instead of nested within the "else". The "Don't search $cdir" bit below should never apply, even in the rare beyond belief case of the user's home expanding to literal "$cdir". Okay with that change. -- Pedro Alves