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 | ff91e322274bdaf4d756826f183a97cd16c3bdd2 (patch) | |
tree | d0de197b515204411fddf8a23333ac92c9410d70 /file.c | |
parent | c9dbb0727f77e4f4d8f94b12008297d86ad56819 (diff) | |
download | ruby-ff91e322274bdaf4d756826f183a97cd16c3bdd2.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); |