Fix previous commit, it means not need to make the condition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7671e7dd35
commit
70be643c5b
4
string.c
4
string.c
@ -1920,16 +1920,12 @@ rb_enc_cr_str_buf_cat(VALUE str, const char *ptr, long len,
|
|||||||
int str_encindex = ENCODING_GET(str);
|
int str_encindex = ENCODING_GET(str);
|
||||||
int res_encindex;
|
int res_encindex;
|
||||||
int str_cr, res_cr;
|
int str_cr, res_cr;
|
||||||
int ptr_a8 = ptr_encindex == 0;
|
|
||||||
|
|
||||||
str_cr = ENC_CODERANGE(str);
|
str_cr = ENC_CODERANGE(str);
|
||||||
|
|
||||||
if (str_encindex == ptr_encindex) {
|
if (str_encindex == ptr_encindex) {
|
||||||
if (str_cr == ENC_CODERANGE_UNKNOWN)
|
if (str_cr == ENC_CODERANGE_UNKNOWN)
|
||||||
ptr_cr = ENC_CODERANGE_UNKNOWN;
|
ptr_cr = ENC_CODERANGE_UNKNOWN;
|
||||||
else if (ptr_a8 && str_cr == ENC_CODERANGE_VALID)
|
|
||||||
/* since str is also ASCII-8BIT, 7bit nor unknown means valid */
|
|
||||||
ptr_cr = ENC_CODERANGE_VALID;
|
|
||||||
else if (ptr_cr == ENC_CODERANGE_UNKNOWN) {
|
else if (ptr_cr == ENC_CODERANGE_UNKNOWN) {
|
||||||
ptr_cr = coderange_scan(ptr, len, rb_enc_from_index(ptr_encindex));
|
ptr_cr = coderange_scan(ptr, len, rb_enc_from_index(ptr_encindex));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user