All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Mabee <rmabee@comcast.net>
To: grub-devel@gnu.org
Subject: [PATCH] '.' causes wildcard expansion
Date: Mon, 11 Jun 2012 02:56:20 -0400	[thread overview]
Message-ID: <4FD59694.3080600@comcast.net> (raw)

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 <rmabee@comcast.net>
+
+    * 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 <phcoder@gmail.com>

      * 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)




             reply	other threads:[~2012-06-11  6:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-11  6:56 Robert Mabee [this message]
2012-06-13 22:42 ` [PATCH] '.' causes wildcard expansion Robert Mabee
2012-06-18 11:03   ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-06-19 12:19   ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-06-20  8:04     ` Robert Mabee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FD59694.3080600@comcast.net \
    --to=rmabee@comcast.net \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.