From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14878 invoked by alias); 15 Nov 2010 18:34:11 -0000 Received: (qmail 14819 invoked by uid 22791); 15 Nov 2010 18:34:10 -0000 X-SWARE-Spam-Status: No, hits=-0.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout23.012.net.il (HELO mtaout23.012.net.il) (80.179.55.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 15 Nov 2010 18:33:20 +0000 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0LBX00G00VIS0500@a-mtaout23.012.net.il> for gdb-patches@sourceware.org; Mon, 15 Nov 2010 20:33:17 +0200 (IST) Received: from HOME-C4E4A596F7 ([77.126.249.126]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LBX00FFCVJFQF80@a-mtaout23.012.net.il>; Mon, 15 Nov 2010 20:33:17 +0200 (IST) Date: Mon, 15 Nov 2010 18:34:00 -0000 From: Eli Zaretskii Subject: Re: [patch]change dwarf2_start_subfile() to adapt inappropriate dir name In-reply-to: <20101115180513.GJ8544@codesourcery.com> To: Nathan Froyd Cc: brobecker@adacore.com, j0.kim@samsung.com, gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83k4kecu8a.fsf@gnu.org> References: <13428716.22191289802305139.JavaMail.weblogic@epml17> <20101115165834.GA4434@adacore.com> <20101115180513.GJ8544@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: 2010-11/txt/msg00179.txt.bz2 > Date: Mon, 15 Nov 2010 10:05:14 -0800 > From: Nathan Froyd > Cc: JuYoung Kim , Eli Zaretskii , > "gdb-patches@sourceware.org" > > + if (dirname[dir_len-1] == SLASH_STRING[0]) Sorry, but comparing with SLASH_STRING[0] is as bad as comparing with a literal '/' or '\\'. The issue here is that DOS/Windows filesystems can use both / and \, and even mix them freely in the same file name. IS_DIR_SEPARATOR takes this into account, while comparing against a single character will miss the other alternative. SLASH_STRING is for _constructing_ file names (with `concat' or equivalent code), not for taking file names apart or examining them.