summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-17 21:46:40 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-17 21:46:40 +0000
commit0fe64561955534e9ee376e766509048d9957e67a (patch)
treee0062d0c95efd931dee8a7dca217a02541eea5c4 /dir.c
parentddffaf5208b679e4b54bc6391eafece54392c1c3 (diff)
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
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/dir.c b/dir.c
index 2f38e35976..a8aebefb52 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;