summaryrefslogtreecommitdiff
path: root/gem_prelude.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-26 11:22:44 (GMT)
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-26 11:22:44 (GMT)
commit303b1d7fad17f3b8a1816eea12e04d72f044b0ce (patch)
treecce6c1b2bd248fd9c85b77e61cf1f3e61cc3324b /gem_prelude.rb
parent39e457b4e7896bf857b88b361dc0202ba3327961 (diff)
* gem_prelude.rb (Gem.set_home): must dup before force_encoding
and must force_encoding before gsub. cf. Yen Sign problem of SJIS [ruby-core:26910] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gem_prelude.rb')
-rw-r--r--gem_prelude.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/gem_prelude.rb b/gem_prelude.rb
index 15a1b43..5e12ac1 100644
--- a/gem_prelude.rb
+++ b/gem_prelude.rb
@@ -66,8 +66,9 @@ if defined?(Gem) then
end
def self.set_home(home)
- home = home.gsub File::ALT_SEPARATOR, File::SEPARATOR if File::ALT_SEPARATOR
- @gem_home = home.force_encoding(Encoding.find('filesystem'))
+ home = home.dup.force_encoding(Encoding.find('filesystem'))
+ home.gsub!(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
+ @gem_home = home
end
def self.set_paths(gpaths)