mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
3cb57fb1c3
commit
50a860d006
5 changed files with 16 additions and 10 deletions
|
@ -1,3 +1,12 @@
|
|||
Fri Feb 29 02:50:07 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* 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 <nagai@ai.kyutech.ac.jp>
|
||||
|
||||
* ext/tk/lib/tk.rb: forgot to update RELEASE_DATE
|
||||
|
|
6
hash.c
6
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++;
|
||||
|
|
2
object.c
2
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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
3
string.c
3
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;
|
||||
|
|
|
@ -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[];
|
||||
|
|
Loading…
Reference in a new issue