diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-13 01:02:43 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-13 01:02:43 +0000 |
commit | 0eb7def2ad3d750e427b713c89c868d78691b57a (patch) | |
tree | bd6e1db311ac47a29dbe191fedaccb225a0cb3bf /ruby.c | |
parent | 33f6ae913a8f46d3c2415b41508911c80d3f27a7 (diff) |
merges r20625, r20633, r20656 and r20665 from trunk into ruby_1_9_1.
--
* encoding.c (enc_set_default_encoding): allowed to set default
encoding.
--
* encoding.c (rb_enc_aliases_enc_i): skips default internal.
--
* encoding.c (enc_get_default_encoding): removed.
Generalizing rb_default_{external,internal}_encoding seems to be
difficult.
default_external cannot be NULL even before detected. [ruby-dev:37390]
* encoding.c (rb_default_external_encoding): has its own
implementation again.
* encoding.c (rb_default_internal_encoding): ditto.
* gem_prelude.rb: added notice.
* ruby.c (rubylib_mangled_path, rubylib_mangled_path2): uses locale
encoding but not ASCII-8BIT.
* ruby.c (process_options): refers less to default_external.
--
* encoding.c (rb_enc_set_default_external): default_internal can be
nil, but default_external cannot.
* encoding.c (rb_set_default_internal): adds rdoc.
* encoding.c (enc_find): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@20698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r-- | ruby.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -210,9 +210,9 @@ rubylib_mangled_path(const char *s, unsigned int l) } } if (!newp || l < oldl || STRNCASECMP(oldp, s, oldl) != 0) { - return rb_str_new(s, l); + return rb_locale_str_new(s, l); } - ret = rb_str_new(0, l + newl - oldl); + ret = rb_locale_str_new(0, l + newl - oldl); ptr = RSTRING_PTR(ret); memcpy(ptr, newp, newl); memcpy(ptr + newl, s + oldl, l - oldl); @@ -226,8 +226,8 @@ rubylib_mangled_path2(const char *s) return rubylib_mangled_path(s, strlen(s)); } #else -#define rubylib_mangled_path rb_str_new -#define rubylib_mangled_path2 rb_str_new2 +#define rubylib_mangled_path rb_locale_str_new +#define rubylib_mangled_path2 rb_locale_str_new_cstr #endif static void @@ -1141,7 +1141,7 @@ process_options(VALUE arg) } } - ruby_script(opt->script); + rb_progname = rb_obj_freeze(rb_str_new_cstr(opt->script)); #if defined DOSISH || defined __CYGWIN__ translate_char(RSTRING_PTR(rb_progname), '\\', '/'); #endif @@ -1641,7 +1641,7 @@ ruby_process_options(int argc, char **argv) struct cmdline_options opt; NODE *tree; - ruby_script(argv[0]); /* for the time being */ + ruby_script(argv[0]); /* for the time being */ rb_argv0 = rb_str_new4(rb_progname); rb_gc_register_mark_object(rb_argv0); args.argc = argc; |