From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10876 invoked by alias); 23 Mar 2011 14:44:44 -0000 Received: (qmail 10812 invoked by uid 22791); 23 Mar 2011 14:44:43 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,TW_BJ,TW_DB,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 23 Mar 2011 14:44:38 +0000 Received: (qmail 624 invoked from network); 23 Mar 2011 14:44:37 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 23 Mar 2011 14:44:37 -0000 From: Pedro Alves To: Kai Tietz Subject: Re: [patch gdb]: Fix some DOS-path related issues in gdb Date: Wed, 23 Mar 2011 15:29:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-28-generic; KDE/4.6.1; x86_64; ; ) Cc: gdb-patches@sourceware.org, Eli Zaretskii , Joel Brobecker References: <201103231244.33842.pedro@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201103231444.34735.pedro@codesourcery.com> 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: 2011-03/txt/msg01026.txt.bz2 On Wednesday 23 March 2011 14:07:01, Kai Tietz wrote: > @@ -1023,12 +1025,13 @@ elfstab_offset_sections (struct objfile > struct stab_section_info *maybe = dbx->stab_section_info; > struct stab_section_info *questionable = 0; > int i; > - char *p; > + const char *p; > > /* The ELF symbol info doesn't include path names, so strip the path > (if any) from the psymtab filename. */ > - while (0 != (p = strchr (filename, '/'))) > - filename = p + 1; > + p = lbasename (filename); > + if (p != filename) > + filename = p; These three lines are the same as just: filename = lbasename (filename); You can then drop the unnecessary `p' local. The patch looked good to me with that change. -- Pedro Alves