summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-13 03:17:28 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-13 03:17:28 +0000
commitbd13788fdbe8617eb3a65e98ddb4acc2b5e4f598 (patch)
treed85dc3e6fd79d001de5628ba35933c3057985eba /lib
parent2854a7f121861b7508809815532d6827b8bb9929 (diff)
lib/shellwords.rb: do not change API with frozen-string-literal
This fixes a bug introduced in r53066 when attempting to shellescape an empty string. * lib/shellwords.rb (shellescape): duplicate frozen literal * test/test_shellwords.rb (test_stringification): new test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/shellwords.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/shellwords.rb b/lib/shellwords.rb
index d02d3b06d5..66092c8999 100644
--- a/lib/shellwords.rb
+++ b/lib/shellwords.rb
@@ -125,7 +125,7 @@ module Shellwords
str = str.to_s
# An empty argument will be skipped, so return empty quotes.
- return "''" if str.empty?
+ return "''".dup if str.empty?
str = str.dup