diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-21 21:40:21 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-21 21:40:21 +0000 |
commit | 01e1dcef9a275797d1497fcf91c2873b91573469 (patch) | |
tree | 91f88b946ee738032bf7a9d66c0bd06a5d03f374 /lib | |
parent | 1d9cac36ea4d84a6e3242c7b8a30d05b6df64145 (diff) |
* backport of r32600 from trunk
* lib/csv.rb: Do not modify CSV.generate's argument [ruby-core:38356]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/csv.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/csv.rb b/lib/csv.rb index ce05164c75..13f86ec318 100644 --- a/lib/csv.rb +++ b/lib/csv.rb @@ -1234,7 +1234,7 @@ class CSV io.seek(0, IO::SEEK_END) args.unshift(io) else - encoding = args.last.is_a?(Hash) ? args.last.delete(:encoding) : nil + encoding = (args[-1] = args[-1].dup).delete(:encoding) if args.last.is_a?(Hash) str = "" str.encode!(encoding) if encoding args.unshift(str) |