diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-07 06:02:21 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-07 06:02:21 +0000 |
commit | 8a0ab36db160331190299a5b6e5483b8b47e98e2 (patch) | |
tree | d0de197b515204411fddf8a23333ac92c9410d70 /file.c | |
parent | 548497d545b72aa3a73ee7514cc4aacbe1c7536e (diff) | |
download | ruby-8a0ab36db160331190299a5b6e5483b8b47e98e2.tar.gz |
file.c: skip invalid byte
* file.c (rb_str_normalize_ospath): skip invalid byte sequence not
to loop infinitely. this case usually does not happen as the
input name should come from real file systems.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -294,6 +294,8 @@ rb_str_normalize_ospath(const char *ptr, long len) rb_str_append(str, rb_str_normalize_ospath0(p1, p-p1)); rb_str_cat2(str, "\xEF\xBF\xBD"); p += 1; + p1 = p; + continue; } l = MBCLEN_CHARFOUND_LEN(r); c = rb_enc_mbc_to_codepoint(p, e, enc); |