From: Vladimir 'phcoder' Serbinenko Date: Wed, 27 Jun 2012 19:13:06 +0000 (+0200) Subject: * grub-core/commands/wildcard.c (check_file): Fix bad logic. X-Git-Tag: 2.00~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58eee08fffd2a49229a9c241d74a40d0426e35f3;p=thirdparty%2Fgrub.git * grub-core/commands/wildcard.c (check_file): Fix bad logic. put explicit "/" for empty path. (wildcard_expand): Improve dprintf. --- diff --git a/ChangeLog b/ChangeLog index 30013844f..e9c42b3e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-06-27 Vladimir Serbinenko + + * grub-core/commands/wildcard.c (check_file): Fix bad logic. + put explicit "/" for empty path. + (wildcard_expand): Improve dprintf. + 2012-06-27 Vladimir Serbinenko * grub-core/fs/fshelp.c (grub_fshelp_find_file): Don't free oldnode if diff --git a/grub-core/commands/wildcard.c b/grub-core/commands/wildcard.c index 56eea10b7..2b73d9ad8 100644 --- a/grub-core/commands/wildcard.c +++ b/grub-core/commands/wildcard.c @@ -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;