[Bug #19042] Fix Dir.glob brace with '/'

Dir.glob brace pattern with '/' after '**' does not match
paths in recursive expansion process.
We expand braces with '/' before expanding a recursive.

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
This commit is contained in:
Hiroshi Shirosaki 2022-10-18 09:18:03 +09:00
parent 995bdd69de
commit 329d5424a4
2 changed files with 15 additions and 1 deletions

2
dir.c
View file

@ -2305,7 +2305,7 @@ glob_helper(
#endif
break;
case BRACE:
if (!recursive) {
if (!recursive || strchr(p->str, '/')) {
brace = 1;
}
break;