From aa06e69000ef8e1ba440925462672f359f91c48d Mon Sep 17 00:00:00 2001 From: yugui Date: Fri, 12 Dec 2008 05:25:39 +0000 Subject: * 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ruby.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ruby.c') diff --git a/ruby.c b/ruby.c index 913b454fd7..0b6bb8227e 100644 --- a/ruby.c +++ b/ruby.c @@ -213,9 +213,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); @@ -229,8 +229,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 @@ -1178,7 +1178,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 @@ -1670,7 +1670,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; -- cgit v1.2.3