aboutsummaryrefslogtreecommitdiffstats
path: root/dir.c
diff options
context:
space:
mode:
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;
}