]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/commands/wildcard.c (check_file): Fix bad logic.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 27 Jun 2012 19:13:06 +0000 (21:13 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 27 Jun 2012 19:13:06 +0000 (21:13 +0200)
put explicit "/" for empty path.
(wildcard_expand): Improve dprintf.

ChangeLog
grub-core/commands/wildcard.c

index 30013844f83c867c06df80e2dfcefda644864478..e9c42b3e6576ec08120c79cb9135a9eb1b42315d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-06-27  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/commands/wildcard.c (check_file): Fix bad logic.
+       put explicit "/" for empty path.
+       (wildcard_expand): Improve dprintf.
+
 2012-06-27  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/fs/fshelp.c (grub_fshelp_find_file): Don't free oldnode if
index 56eea10b782591267c8f82ddd8086d50cc25cb94..2b73d9ad886b1bafdc39e827d23f0cc23d6536b4 100644 (file)
@@ -381,7 +381,7 @@ check_file (const char *dir, const char *basename)
   int match (const char *name, const struct grub_dirhook_info *info)
   {
     if (basename[0] == 0
-       && (info->case_insensitive ? grub_strcasecmp (name, basename) == 0
+       || (info->case_insensitive ? grub_strcasecmp (name, basename) == 0
            : grub_strcmp (name, basename) == 0))
       {
        found = 1;
@@ -410,7 +410,7 @@ check_file (const char *dir, const char *basename)
   else
     path = dir;
 
-  fs->dir (dev, path, match);
+  fs->dir (dev, path[0] ? path : "/", match);
   if (grub_errno == 0 && basename[0] == 0)
     found = 1;
 
@@ -505,8 +505,8 @@ wildcard_expand (const char *s, char ***strs)
                  *p = 0;
                  if (!check_file (n, p + 1))
                    {
-                     grub_dprintf ("expand", "file <%s> not found\n",
-                                   start);
+                     grub_dprintf ("expand", "file <%s> in <%s> not found\n",
+                                   p + 1, n);
                      grub_free (o);
                      grub_free (n);
                              continue;