diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-04-14 05:33:40 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-04-14 05:33:40 +0000 |
commit | 925cc8ffd010df19a044875df252e939eaf0a8da (patch) | |
tree | 99c81610a8ed39748ea0318b409611c13c650627 | |
parent | 9aa67e267b9c8d84e49464ea6f83e6f31c38efca (diff) | |
download | ruby-925cc8ffd010df19a044875df252e939eaf0a8da.tar.gz |
string.c: keep source code range
* string.c (rb_enc_cr_str_buf_cat): keep code range of the source
string even if code range of the destination string is unknown.
no reason to the former is affected by the latter.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | string.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -2090,9 +2090,7 @@ rb_enc_cr_str_buf_cat(VALUE str, const char *ptr, long len, str_cr = RSTRING_LEN(str) ? ENC_CODERANGE(str) : ENC_CODERANGE_7BIT; if (str_encindex == ptr_encindex) { - if (str_cr == ENC_CODERANGE_UNKNOWN) - ptr_cr = ENC_CODERANGE_UNKNOWN; - else if (ptr_cr == ENC_CODERANGE_UNKNOWN) { + if (str_cr != ENC_CODERANGE_UNKNOWN && ptr_cr == ENC_CODERANGE_UNKNOWN) { ptr_cr = coderange_scan(ptr, len, rb_enc_from_index(ptr_encindex)); } } |