summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-07 00:11:00 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-07 00:11:00 (GMT)
commit461c38a9737edda4baf909ef3993b588150c97b2 (patch)
tree2bffca9881fdb816b85de047bd1767b30345cbf2 /dir.c
parent6548425ee0339de8bab5e0124d0c3f57d517b953 (diff)
dir.c: fix escaping multibyte char
* dir.c (has_magic): fix escaping multibyte char, with glob meta-char in trailing bytes, e.g., Shift-JIS git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/dir.c b/dir.c
index e2a19f1..041d88a 100644
--- a/dir.c
+++ b/dir.c
@@ -1205,9 +1205,9 @@ has_magic(const char *p, const char *pend, int flags, rb_encoding *enc)
return MAGICAL;
case '\\':
- if (escape && !(c = *p++))
- return PLAIN;
- continue;
+ if (escape && p++ >= pend)
+ continue;
+ break;
#ifdef _WIN32
case '~':