mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* string.c (str_new): sets empty string to coderange 7bit.
[ruby-core:18993] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0b99ce1fd6
commit
8d397604bf
2 changed files with 8 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
Sun Sep 28 12:04:18 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* string.c (str_new): sets empty string to coderange 7bit.
|
||||
[ruby-core:18993]
|
||||
|
||||
Sun Sep 28 09:39:48 2008 Tadayoshi Funaba <tadf@dotrb.org>
|
||||
|
||||
* lib/mathn.rb ({Fixnum,Bignum,Float}#**): may produce complex
|
||||
|
|
3
string.c
3
string.c
|
@ -395,6 +395,9 @@ str_new(VALUE klass, const char *ptr, long len)
|
|||
RSTRING(str)->as.heap.ptr = ALLOC_N(char,len+1);
|
||||
STR_SET_NOEMBED(str);
|
||||
}
|
||||
else if (len == 0) {
|
||||
ENC_CODERANGE_SET(str, ENC_CODERANGE_7BIT);
|
||||
}
|
||||
if (ptr) {
|
||||
memcpy(RSTRING_PTR(str), ptr, len);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue