diff --git a/ChangeLog b/ChangeLog index 020214f545..eafe478b3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Fri Feb 29 02:50:07 2008 NARUSE, Yui + + * 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. + Fri Feb 29 02:24:22 2008 Hidetoshi NAGAI * ext/tk/lib/tk.rb: forgot to update RELEASE_DATE diff --git a/hash.c b/hash.c index 53711b2cc2..578e4cd395 100644 --- a/hash.c +++ b/hash.c @@ -1826,7 +1826,7 @@ rb_f_getenv(VALUE obj, VALUE name) if (strcmp(nam, PATH_ENV) == 0 && !rb_env_path_tainted()) #endif { - VALUE str = rb_usascii_str_new2(env); + VALUE str = rb_str_new2(env); rb_obj_freeze(str); return str; @@ -1867,7 +1867,7 @@ env_fetch(int argc, VALUE *argv) #else if (strcmp(nam, PATH_ENV) == 0 && !rb_env_path_tainted()) #endif - return rb_usascii_str_new2(env); + return rb_str_new2(env); return env_str_new2(env); } @@ -2244,7 +2244,7 @@ env_inspect(void) rb_str_buf_cat2(str, "\""); rb_str_buf_cat(str, *env, s-*env); rb_str_buf_cat2(str, "\"=>"); - i = rb_inspect(rb_usascii_str_new2(s+1)); + i = rb_inspect(rb_str_new2(s+1)); rb_str_buf_append(str, i); } env++; diff --git a/object.c b/object.c index 2dc87610da..1585b87feb 100644 --- a/object.c +++ b/object.c @@ -808,7 +808,7 @@ nil_to_f(VALUE obj) static VALUE nil_to_s(VALUE obj) { - return rb_str_new(0, 0); + return rb_usascii_str_new(0, 0); } /* 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; diff --git a/version.h b/version.h index 5fd795113b..1e56af9eb9 100644 --- a/version.h +++ b/version.h @@ -1,7 +1,7 @@ #define RUBY_VERSION "1.9.0" -#define RUBY_RELEASE_DATE "2008-02-28" +#define RUBY_RELEASE_DATE "2008-02-29" #define RUBY_VERSION_CODE 190 -#define RUBY_RELEASE_CODE 20080228 +#define RUBY_RELEASE_CODE 20080229 #define RUBY_PATCHLEVEL 0 #define RUBY_VERSION_MAJOR 1 @@ -9,7 +9,7 @@ #define RUBY_VERSION_TEENY 0 #define RUBY_RELEASE_YEAR 2008 #define RUBY_RELEASE_MONTH 2 -#define RUBY_RELEASE_DAY 28 +#define RUBY_RELEASE_DAY 29 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[];