From 8176a62ff210dd83b4d2db4b173b7ac0ec392a92 Mon Sep 17 00:00:00 2001 From: naruse Date: Mon, 28 Sep 2009 19:24:18 +0000 Subject: * hash.c (rb_f_getenv): use rb_filesystem_str_new_cstr instead of rb_str_new2. ENV['PATH'].encoding should be Filesystem Encoding because its content is related to filesystem. see [ruby-dev:39393] * hash.c (env_fetch): ditto. * string.c (rb_filesystem_str_new): defined. * string.c (rb_filesystem_str_new_cstr): ditto. * include/ruby/intern.h (rb_filesystem_str_new): added. * include/ruby/intern.h (rb_filesystem_str_new_cstr): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'string.c') diff --git a/string.c b/string.c index a70bbaab5..35a4253d2 100644 --- a/string.c +++ b/string.c @@ -574,6 +574,18 @@ rb_locale_str_new_cstr(const char *ptr) return rb_external_str_new_with_enc(ptr, strlen(ptr), rb_locale_encoding()); } +VALUE +rb_filesystem_str_new(const char *ptr, long len) +{ + return rb_external_str_new_with_enc(ptr, len, rb_filesystem_encoding()); +} + +VALUE +rb_filesystem_str_new_cstr(const char *ptr) +{ + return rb_external_str_new_with_enc(ptr, strlen(ptr), rb_filesystem_encoding()); +} + VALUE rb_str_export(VALUE str) { -- cgit