From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1SdyY8-00007P-Rd for mharc-grub-devel@gnu.org; Mon, 11 Jun 2012 02:56:28 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54699) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SdyY6-000076-6z for grub-devel@gnu.org; Mon, 11 Jun 2012 02:56:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SdyY4-0002ob-IO for grub-devel@gnu.org; Mon, 11 Jun 2012 02:56:25 -0400 Received: from qmta13.westchester.pa.mail.comcast.net ([76.96.59.243]:57558) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SdyY4-0002oT-ED for grub-devel@gnu.org; Mon, 11 Jun 2012 02:56:24 -0400 Received: from omta22.westchester.pa.mail.comcast.net ([76.96.62.73]) by qmta13.westchester.pa.mail.comcast.net with comcast id LuvJ1j0011ap0As5DuwMfv; Mon, 11 Jun 2012 06:56:21 +0000 Received: from [192.168.1.101] ([24.63.69.222]) by omta22.westchester.pa.mail.comcast.net with comcast id LuwL1j00C4nkFao3iuwMz9; Mon, 11 Jun 2012 06:56:21 +0000 Message-ID: <4FD59694.3080600@comcast.net> Date: Mon, 11 Jun 2012 02:56:20 -0400 From: Robert Mabee User-Agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: grub-devel@gnu.org Subject: [PATCH] '.' causes wildcard expansion Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 76.96.59.243 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2012 06:56:27 -0000 Wildcard expansion in device name activates my floppy drive (PC BIOS). I noticed that echo . also did so in 1.99, though there should be no expansion. Current source fixes that case but echo (. still runs the floppy. split_path shouldn't treat . as a wildcard. I believe the regcomp call in make_regex is incorrect because the constant used is intended only for a lower-level interface. The defines are more than a little confusing. === modified file 'ChangeLog' --- old/ChangeLog 2012-06-09 17:58:38 +0000 +++ new/ChangeLog 2012-06-11 06:32:58 +0000 @@ -1,3 +1,8 @@ +2012-06-11 Bob Mabee + + * commands/wildcard.c (split_path): . is not a wildcard. + * (make_regex): RE_SYNTAX_GNU_AWK is not valid for regcomp cflags. + 2012-06-09 Vladimir Serbinenko * tests/grub_script_expansion.in: Explicitly tell grep that we handle === modified file 'grub-core/commands/wildcard.c' --- old/grub-core/commands/wildcard.c 2012-06-08 20:54:21 +0000 +++ new/grub-core/commands/wildcard.c 2012-06-10 23:16:02 +0000 @@ -153,7 +153,7 @@ buffer[i] = '\0'; grub_dprintf ("expand", "Regexp is %s\n", buffer); - if (regcomp (regexp, buffer, RE_SYNTAX_GNU_AWK)) + if (regcomp (regexp, buffer, REG_EXTENDED)) { grub_free (buffer); return 1; @@ -181,7 +181,7 @@ if (ch == '\\' && end[1]) end++; - else if (isregexop (ch)) + else if (ch == '*') /* only wildcard currently implemented */ regex = 1; else if (ch == '/' && ! regex)