Project

General

Profile

Bug #15540

2.6.0 Dir#glob regression

Added by bughit (bug hit) 4 months ago. Updated 4 months 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

Associated revisions

Revision d1417ff8
Added by shirosaki 4 months ago

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]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 66838
Added by shirosaki 4 months ago

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]

Revision 0fe64561
Added by naruse (Yui NARUSE) 4 months ago

merge revision(s) 66838: [Backport #15540]

    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]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@66848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 66848
Added by naruse (Yui NARUSE) 4 months ago

merge revision(s) 66838: [Backport #15540]

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]

History

Updated by h.shirosaki (Hiroshi Shirosaki) 4 months ago

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

#2

Updated by Anonymous 4 months 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) 4 months 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