From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30353 invoked by alias); 11 Jan 2012 21:49:55 -0000 Received: (qmail 30341 invoked by uid 22791); 11 Jan 2012 21:49:53 -0000 X-SWARE-Spam-Status: No, hits=-7.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,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; Wed, 11 Jan 2012 21:49:40 +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 q0BLnd7P031103 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 11 Jan 2012 16:49:39 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q0BLncnR013877; Wed, 11 Jan 2012 16:49:38 -0500 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id q0BLnbWj016366; Wed, 11 Jan 2012 16:49:37 -0500 From: Tom Tromey To: Eli Zaretskii Cc: gdb-patches@sourceware.org Subject: Re: RFC: add relative file name handling for linespecs References: <83ipkjeagi.fsf@gnu.org> Date: Wed, 11 Jan 2012 21:52:00 -0000 In-Reply-To: <83ipkjeagi.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 10 Jan 2012 19:25:33 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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-01/txt/msg00383.txt.bz2 >>>>> "Eli" == Eli Zaretskii writes: Tom> +/* See whether FILENAME matches SEARCH_NAME using the rule that we Tom> + advertise to the user. Eli> Why not say explicitly how the names are matched? "The rule we Eli> advertise" doesn't give any hint where to look for that rule, so the Eli> issue remains a mystery and requires to read the source to glean what Eli> this does. I will mention the manual. Tom> + /* Either the names must completely match, or the character Tom> + preceding the trailing SEARCH_NAME segment of FILENAME must be a Tom> + directory separator. */ Tom> + return (len == search_len Tom> + || IS_DIR_SEPARATOR (filename[len - search_len - 1])); Eli> What about the (somewhat perverse) case of "d:foo/bar" and "foo/bar" Eli> on Windows? Would something like this work? || (HAS_DRIVE_SPEC (filename) && len - search_len == 2) Tom