From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31184 invoked by alias); 9 Mar 2011 05:29:23 -0000 Received: (qmail 30838 invoked by uid 22791); 9 Mar 2011 05:29:20 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (140.186.70.10) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 09 Mar 2011 05:29:12 +0000 Received: from eliz by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1PxBxN-0005a9-GM; Wed, 09 Mar 2011 00:29:09 -0500 Date: Wed, 09 Mar 2011 07:12:00 -0000 Message-Id: From: Eli Zaretskii To: Pedro Alves CC: gdb-patches@sourceware.org, dj@redhat.com, ktietz70@googlemail.com, binutils@sourceware.org, gcc-patches@gcc.gnu.org In-reply-to: <201103082238.00289.pedro@codesourcery.com> (message from Pedro Alves on Tue, 8 Mar 2011 22:37:59 +0000) Subject: Re: [patch libiberty include]: Add additional helper functions for directory-separator searching Reply-to: Eli Zaretskii References: <83aah5h34g.fsf@gnu.org> <201103081941.p28Jf0Uq027041@greed.delorie.com> <201103082238.00289.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/msg00586.txt.bz2 > From: Pedro Alves > Date: Tue, 8 Mar 2011 22:37:59 +0000 > Cc: DJ Delorie , > Eli Zaretskii , > ktietz70@googlemail.com, > binutils@sourceware.org, > gcc-patches@gcc.gnu.org > > Actually, is there any case where lbasename wouldn't > work instead of filename_dirrchr? Almost: lbasename returns a pointer one character _after_ the last slash. It also skips the drive letter on DOS/Windows (which might be TRT, actually). It would be reasonable to rewrite filename_dirrchr in terms of lbasename, though, by backing up the pointer returned by lbasename if it points to a slash, and otherwise returning NULL. The case of "d:foo" should also be resolved (probably, return a pointer to the colon).