Project

General

Profile

Backport #6977

Ruby 1.9.3 Dir.glob strange recursive match behaviour

Added by jasonling (Jason Ling) about 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
[ruby-core:47418]

Description

Assuming a directory structure of:

a/b/c/d/e/f/g/h

I am trying to find 'h' via:

Dir.glob('a/**/f/g/h')

However this is not working. Any ideas?

You can try the test case below:

$ /usr/bin/ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
$ mkdir -p a/b/c/d/e/f/g/h
$ ruby -e "puts Dir.glob('a//*')"
a/b
a/b/c
a/b/c/d
a/b/c/d/e
a/b/c/d/e/f
a/b/c/d/e/f/g
a/b/c/d/e/f/g/h
$ ruby -e "puts Dir.glob('a/
/h')"
a/b/c/d/e/f/g/h
$ ruby -e "puts Dir.glob('a//g/h')"
a/b/c/d/e/f/g/h
$ ruby -e "puts Dir.glob('a/
/f/g/h')"
nothing

Associated revisions

Revision 83185f91
Added by nobu (Nobuyoshi Nakada) about 7 years ago

dir.c: fix recursion

  • dir.c (glob_make_pattern): names under recursive need to be single basenames to match for each name. [ruby-core:47418] [Bug #6977]

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

Revision 36905
Added by nobu (Nobuyoshi Nakada) about 7 years ago

dir.c: fix recursion

  • dir.c (glob_make_pattern): names under recursive need to be single basenames to match for each name. [ruby-core:47418] [Bug #6977]

Revision 36905
Added by nobu (Nobuyoshi Nakada) about 7 years ago

dir.c: fix recursion

  • dir.c (glob_make_pattern): names under recursive need to be single basenames to match for each name. [ruby-core:47418] [Bug #6977]

Revision 36905
Added by nobu (Nobuyoshi Nakada) about 7 years ago

dir.c: fix recursion

  • dir.c (glob_make_pattern): names under recursive need to be single basenames to match for each name. [ruby-core:47418] [Bug #6977]

Revision 36905
Added by nobu (Nobuyoshi Nakada) about 7 years ago

dir.c: fix recursion

  • dir.c (glob_make_pattern): names under recursive need to be single basenames to match for each name. [ruby-core:47418] [Bug #6977]

Revision 36905
Added by nobu (Nobuyoshi Nakada) about 7 years ago

dir.c: fix recursion

  • dir.c (glob_make_pattern): names under recursive need to be single basenames to match for each name. [ruby-core:47418] [Bug #6977]

Revision 36905
Added by nobu (Nobuyoshi Nakada) about 7 years ago

dir.c: fix recursion

  • dir.c (glob_make_pattern): names under recursive need to be single basenames to match for each name. [ruby-core:47418] [Bug #6977]

Revision 10d2b5ec
Added by usa (Usaku NAKAMURA) over 6 years ago

merge revision(s) 36905: [Backport #6977]

    * dir.c (glob_make_pattern): names under recursive need to be single
      basenames to match for each name.  [ruby-core:47418] [Bug #6977]

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

Revision 39090
Added by usa (Usaku NAKAMURA) over 6 years ago

merge revision(s) 36905: [Backport #6977]

* dir.c (glob_make_pattern): names under recursive need to be single
  basenames to match for each name.  [ruby-core:47418] [Bug #6977]

History

#1

Updated by nobu (Nobuyoshi Nakada) about 7 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r36905.
Jason, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


dir.c: fix recursion

  • dir.c (glob_make_pattern): names under recursive need to be single basenames to match for each name. [ruby-core:47418] [Bug #6977]

Updated by cyberkni (Dan Van Derveer) over 6 years ago

This revision has not been released as of 1.9.3p374 which is a bummer since this was fixed quite a while ago.

Is there a reason this hasn't been released?

#3

Updated by usa (Usaku NAKAMURA) over 6 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby master to Backport193
  • Status changed from Closed to Assigned
  • Assignee set to usa (Usaku NAKAMURA)
#4

Updated by usa (Usaku NAKAMURA) over 6 years ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r39090.
Jason, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 36905: [Backport #6977]

* dir.c (glob_make_pattern): names under recursive need to be single
  basenames to match for each name.  [ruby-core:47418] [Bug #6977]

Also available in: Atom PDF