summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-28 18:13:45 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-28 18:13:45 +0000
commit50a860d00635c6de5e32fe753b3adae596192f6d (patch)
treebe3def93895c7a46b2af01b4f7069170c5ea9380 /string.c
parent3cb57fb1c3c2b25bd94660c099f52489a1564354 (diff)
* string.c (str_new): remove encoding assumption of empty string.
* hash.c ( rb_f_getenv, env_fetch, env_inspect): result of ENV should be always ASCII-8BIT. * object.c (nil_to_s): nil.to_s should be US-ASCII. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/string.c b/string.c
index 7b65a6dc14..7c80a84d96 100644
--- a/string.c
+++ b/string.c
@@ -365,9 +365,6 @@ str_new(VALUE klass, const char *ptr, long len)
if (ptr) {
memcpy(RSTRING_PTR(str), ptr, len);
}
- if (len == 0) {
- ENCODING_CODERANGE_SET(str, rb_usascii_encindex(), ENC_CODERANGE_7BIT);
- }
STR_SET_LEN(str, len);
RSTRING_PTR(str)[len] = '\0';
return str;