=== modified file 'grub-core/commands/wildcard.c' --- grub-core/commands/wildcard.c 2012-06-08 20:54:21 +0000 +++ grub-core/commands/wildcard.c 2012-06-18 11:01:31 +0000 @@ -80,7 +80,7 @@ merge (char **dest, char **ps) static inline int isregexop (char ch) { - return grub_strchr ("*.\\", ch) ? 1 : 0; + return grub_strchr ("*.\\|+{}[]", ch) ? 1 : 0; } static char * @@ -128,14 +128,22 @@ make_regex (const char *start, const cha { case '\\': buffer[i++] = ch; - if (*start != '\0') + if (*start == '*' || *start == '?') buffer[i++] = *start++; + else + buffer[i++] = '\\'; break; case '.': case '(': case ')': case '@': + case '|': + case '+': + case '{': + case '}': + case '[': + case ']': buffer[i++] = '\\'; buffer[i++] = ch; break; @@ -145,6 +153,10 @@ make_regex (const char *start, const cha buffer[i++] = '*'; break; + case '?': + buffer[i++] = '.'; + break; + default: buffer[i++] = ch; } @@ -181,7 +193,7 @@ split_path (const char *str, const char if (ch == '\\' && end[1]) end++; - else if (isregexop (ch)) + else if (ch == '*' || ch == '?') regex = 1; else if (ch == '/' && ! regex)