summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-04-18 08:00:04 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-04-18 08:00:04 +0000
commitaf2228a08d38e4ed748f5552c880ef97374364b0 (patch)
tree1abbac26f6c9e49afe01035a6cf1858d729f1693 /string.c
parent0ee6aff847ecccdcfda911b54ad149a1f2543ad2 (diff)
string.c: don't clear coderange at expanding
* string.c (rb_str_modify_expand): like as str_modify_keep_cr, don't clear coderange unless broken. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/string.c b/string.c
index 515a340adc..e5db1feef6 100644
--- a/string.c
+++ b/string.c
@@ -1500,7 +1500,10 @@ rb_str_modify_expand(VALUE str, long expand)
str_make_independent_expand(str, expand);
}
}
- ENC_CODERANGE_CLEAR(str);
+ if (ENC_CODERANGE(str) == ENC_CODERANGE_BROKEN) {
+ /* Force re-scan later */
+ ENC_CODERANGE_CLEAR(str);
+ }
}
/* As rb_str_modify(), but don't clear coderange */