Project

General

Profile

Bug #15540

2.6.0 Dir#glob regression

Added by bughit (bug hit) over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux]
[ruby-core:91110]

Description

in an empty base folder create the following structure

.
└── c
    ├── d
    │   └── a
    │       ├── a.file
    │       └── b
    │           ├── b.file
    │           └── c
    │               └── c.file
    └── e
        └── a
            ├── a.file
            └── b
                ├── b.file
                └── c
                    └── c.file

execute the following in the base folder: ruby -v -e 'pp Dir["c/{d,e}/a/**/"]'

before 2.6

ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]
["c/d/a/", "c/d/a/b/", "c/d/a/b/c/", "c/e/a/", "c/e/a/b/", "c/e/a/b/c/"]

2.6

ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux]
["c/d/a/a.file", "c/d/a/b", "c/e/a/a.file", "c/e/a/b"]

Files

Updated by h.shirosaki (Hiroshi Shirosaki) over 1 year ago

Thanks for report. I attached a patch for the issue.

#2

Updated by Anonymous over 1 year ago

  • Status changed from Open to Closed

Applied in changeset trunk|r66838.


dir.c: fix Dir.glob with braces and matching dir

  • dir.c (join_path_from_pattern): add the last slash for directory
    matching.

  • test/ruby/test_dir.rb (test_glob_recursive_directory): add a test
    for above.
    [ruby-core:91110] [Bug #15540]

Updated by naruse (Yui NARUSE) over 1 year ago

  • Backport changed from 2.4: DONTNEED, 2.5: DONTNEED, 2.6: REQUIRED to 2.4: DONTNEED, 2.5: DONTNEED, 2.6: DONE

ruby_2_6 r66848 merged revision(s) 66838.

Also available in: Atom PDF