mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 06:49:35 +00:00
Fix wildcard regexp dot and other special characters handling.
Reported by: Robert Mabee.
* grub-core/commands/wildcard.c (isregexop): Add "|+{}[]?".
(make_regex): Escape "|+{}[]". Transform '?' to '.?'.
(split_path): Trigger expansion on '?'.
(unescape): New function.
(wildcard_expand): Unescape parts copied without globbing.
* grub-core/script/execute.c (wildcard_escape): Escape '?'.
(grub_script_arglist_to_argv): Don't unescape expansions.
This commit is contained in:
1 parent
0494408e7e
commit
485568790c
3 files changed
+52
-9
No files matched your search
@@ -68,7 +68,7 @@ wildcard_escape (const char *s)
|
||||
i = 0;
|
||||
while ((ch = *s++))
|
||||
{
|
||||
if (ch == '*' || ch == '\\')
|
||||
if (ch == '*' || ch == '\\' || ch == '?')
|
||||
p[i++] = '\\';
|
||||
p[i++] = ch;
|
||||
}
|
||||
@@ -706,7 +706,7 @@ grub_script_arglist_to_argv (struct grub_script_arglist *arglist,
|
||||
for (j = 0; expansions[j]; j++)
|
||||
{
|
||||
failed = (failed || grub_script_argv_next (&result) ||
|
||||
append (expansions[j], -1));
|
||||
append (expansions[j], 0));
|
||||
grub_free (expansions[j]);
|
||||
}
|
||||
grub_free (expansions);
|
||||
|
||||
Reference in new issue
Block a user