ruby-changes:33541
From: nobu <ko1@a...>
Date: Fri, 18 Apr 2014 17:00:10 +0900 (JST)
Subject: [ruby-changes:33541] nobu:r45622 (trunk): string.c: don't clear coderange at expanding
nobu 2014-04-18 17:00:04 +0900 (Fri, 18 Apr 2014) New Revision: 45622 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45622 Log: 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. Modified files: trunk/string.c Index: string.c =================================================================== --- string.c (revision 45621) +++ string.c (revision 45622) @@ -1500,7 +1500,10 @@ rb_str_modify_expand(VALUE str, long exp https://github.com/ruby/ruby/blob/trunk/string.c#L1500 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 */ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/