Skip to content

Commit

Permalink
* string.c (str_new): sets empty string to coderange 7bit.
Browse files Browse the repository at this point in the history
  [ruby-core:18993]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Sep 28, 2008
1 parent 0b99ce1 commit 8d39760
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions string.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 8d39760

Please sign in to comment.