summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-02 09:50:18 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-02 09:50:18 +0000
commitad4b53b3b3ccc9be16a31435f7bed8bf1533362a (patch)
tree2d6dd91f1f8bab908e866b34cd05fb8fb0fc926c /string.c
parentb3e306a5f48814e883be4ab138ecbaebffcb2765 (diff)
merge revision(s) 35863,35864:
* string.c (rb_enc_cr_str_buf_cat): don't reset coderange as unknown. the condition 'ptr_a8 && str_cr != ENC_CODERANGE_7BIT' means not unknown, str is also ASCII-8BIT because str_encindex == ptr_encindex, and nont (str_cr == ENC_CODERANGE_UNKNOWN) and str_cr != ENC_CODERANGE_7BIT means str_cr is valid because ASCII-8BIT can't be broken. [ruby-dev:45688] [Bug #6509] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@35866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/string.c b/string.c
index 134d65b822..fd240bc07a 100644
--- a/string.c
+++ b/string.c
@@ -1909,15 +1909,12 @@ rb_enc_cr_str_buf_cat(VALUE str, const char *ptr, long len,
int str_encindex = ENCODING_GET(str);
int res_encindex;
int str_cr, res_cr;
- int ptr_a8 = ptr_encindex == 0;
str_cr = ENC_CODERANGE(str);
if (str_encindex == ptr_encindex) {
- if (str_cr == ENC_CODERANGE_UNKNOWN ||
- (ptr_a8 && str_cr != ENC_CODERANGE_7BIT)) {
+ if (str_cr == ENC_CODERANGE_UNKNOWN)
ptr_cr = ENC_CODERANGE_UNKNOWN;
- }
else if (ptr_cr == ENC_CODERANGE_UNKNOWN) {
ptr_cr = coderange_scan(ptr, len, rb_enc_from_index(ptr_encindex));
}