From d1417ff8fabe8a99dc6c21830b7b3169bb03aa64 Mon Sep 17 00:00:00 2001 From: shirosaki Date: Wed, 16 Jan 2019 14:06:37 +0000 Subject: 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 --- dir.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'dir.c') diff --git a/dir.c b/dir.c index 2196344fc3..7e5b80793f 100644 --- a/dir.c +++ b/dir.c @@ -2052,6 +2052,10 @@ join_path_from_pattern(struct glob_pattern **beg) case RECURSIVE: str = "**"; break; + case MATCH_DIR: + /* append last slash */ + str = ""; + break; default: str = p->str; if (!str) continue; -- cgit v1.2.1