aboutsummaryrefslogtreecommitdiffstats
path: root/dir.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-22 04:16:21 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-22 04:16:21 +0000
commit6f572fd59164479c03856e52b140b2ec1894463f (patch)
tree0f9fa2d73f521ec43808a327d33c53d531bbf25d /dir.c
parent9c8fc97c0a8f4ad77b868aeda9376f9cdaaa09e4 (diff)
downloadruby-6f572fd59164479c03856e52b140b2ec1894463f.tar.gz
dir.c: glob brace expansion [Fix GH-1061]
* dir.c (ruby_brace_expand): glob brace expansion edge case fix. When there are closing braces '}' before a open brace '{' it must be ignored and considered as literal. [ruby-core:71138] [Bug #11609] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dir.c b/dir.c
index 36cdadc0e9..59057b4908 100644
--- a/dir.c
+++ b/dir.c
@@ -2041,7 +2041,7 @@ ruby_brace_expand(const char *str, int flags, ruby_glob_func *func, VALUE arg,
if (*p == '{' && nest++ == 0) {
lbrace = p;
}
- if (*p == '}' && --nest <= 0) {
+ if (*p == '}' && lbrace && --nest == 0) {
rbrace = p;
break;
}