Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KbdYn-0007DF-VG for mharc-grub-devel@gnu.org; Fri, 05 Sep 2008 11:49:21 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KbdYn-0007D6-3J for grub-devel@gnu.org; Fri, 05 Sep 2008 11:49:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KbdYl-0007CO-Lo for grub-devel@gnu.org; Fri, 05 Sep 2008 11:49:20 -0400 Received: from [199.232.76.173] (port=40145 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KbdYl-0007CL-FV for grub-devel@gnu.org; Fri, 05 Sep 2008 11:49:19 -0400 Received: from ti-out-0910.google.com ([209.85.142.188]:10363) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KbdYk-0003hy-IN for grub-devel@gnu.org; Fri, 05 Sep 2008 11:49:19 -0400 Received: by ti-out-0910.google.com with SMTP id u5so301526tia.10 for ; Fri, 05 Sep 2008 08:49:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=bMc0snsVOo5vPtQReRkd+MIW7Mu25nA0/byBfvTP1Es=; b=BaKMg/bLHBZi/89FnHPp3puuI7efh2dWPLVisGrylsk6qXdeEr9kyBs3/HwDvHsXxq Jq5G7TxNQ+8Gso+TuyACmhcNfn4jO1XLvg14bOUpIV04cZce/cn1Ao42OdC31vFL4Zpk FwNo29wUT0uMMvJbN+IzGOG4sa8tuftGvnVYw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=xyT4vsE2AaLzcHuBdDQzZVCDy+G5w1mA/U1NJ2OnIOfPQg4sakDwSkrrsylkHDugtI 87JPVopq3LqjiPHRxKRUokr71E8RJdyrO8Enzt7qGTTDm0I2VVTscxqaLxdL63roB1Rh g64NL0HFSuNhIl8U/1Wer2pAupvdJkj/mLsW4= Received: by 10.110.15.19 with SMTP id 19mr15151364tio.42.1220629756688; Fri, 05 Sep 2008 08:49:16 -0700 (PDT) Received: by 10.110.57.17 with HTTP; Fri, 5 Sep 2008 08:49:16 -0700 (PDT) Message-ID: Date: Fri, 5 Sep 2008 23:49:16 +0800 From: Bean To: "The development of GRUB 2" In-Reply-To: <20080830124713.GL16775@thorin> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080830124713.GL16775@thorin> X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) Subject: Re: [PATCH] Case insensitive filename for NTFS X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2008 15:49:21 -0000 On Sat, Aug 30, 2008 at 8:47 PM, Robert Millan wrote: > On Sat, Aug 30, 2008 at 03:07:21AM +0800, Bean wrote: >> Hi, >> >> This patch allow case insensitive filename in Win32 and DOS namespace. >> Names in POSIX namespace would still be case sensitive. It also remove >> names in the DOS namespace, as they will reappear in Win32 namespace. > > Nice work :-) > >> --- a/fs/fshelp.c >> +++ b/fs/fshelp.c >> @@ -80,7 +80,13 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode, >> enum grub_fshelp_filetype filetype, >> grub_fshelp_node_t node) >> { >> - if (type == GRUB_FSHELP_UNKNOWN || grub_strcmp (name, filename)) >> + int case_insensitive = (filetype & GRUB_FSHELP_CASE_INSENSITIVE); >> + >> + filetype &= ~GRUB_FSHELP_CASE_INSENSITIVE; >> + if (filetype == GRUB_FSHELP_UNKNOWN || >> + (grub_strcmp (name, filename) && >> + (! case_insensitive || >> + grub_strncasecmp (name, filename, LONG_MAX)))) > > Since `case_insensitive' is only used once, maybe we could skip this > variable? Committed. -- Bean