* grub-core/commands/wildcard.c (match_files): Add a useful dprintf.

(wildcard_expand): Don't stop on nonregexp parts after regexp ones since
	it truncates the output.
	Reported by: Ximin Luo.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-06-24 13:43:10 +02:00
parent 98e2f50661
commit 4388ca7224
2 changed files with 9 additions and 2 deletions

View file

@ -1,3 +1,10 @@
2011-06-24 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/commands/wildcard.c (match_files): Add a useful dprintf.
(wildcard_expand): Don't stop on nonregexp parts after regexp ones since
it truncates the output.
Reported by: Ximin Luo.
2011-06-24 Vladimir Serbinenko <phcoder@gmail.com> 2011-06-24 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/fs/iso9660.c (grub_iso9660_iterate_dir): Skip . and .. * grub-core/fs/iso9660.c (grub_iso9660_iterate_dir): Skip . and ..

View file

@ -288,6 +288,8 @@ match_files (const char *prefix, const char *suffix, const char *end,
if (regexec (regexp, name, 0, 0, 0)) if (regexec (regexp, name, 0, 0, 0))
return 0; return 0;
grub_dprintf ("expand", "matched\n");
buffer = grub_xasprintf ("%s%s", dir, name); buffer = grub_xasprintf ("%s%s", dir, name);
if (! buffer) if (! buffer)
return 1; return 1;
@ -423,8 +425,6 @@ wildcard_expand (const char *s, char ***strs)
while (*start) while (*start)
{ {
split_path (start, &noregexop, &regexop); split_path (start, &noregexop, &regexop);
if (noregexop >= regexop) /* no more wildcards */
break;
if (make_regex (noregexop, regexop, &regexp)) if (make_regex (noregexop, regexop, &regexp))
goto fail; goto fail;