summaryrefslogtreecommitdiffstats
path: root/lib/shellwords.rb
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-19 14:13:01 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-19 14:13:01 +0000
commit3288d1e16b2a8532e85bdb5c6029b58109294be5 (patch)
tree901fc40402a684969dbf2bb8109c010e65e89dd8 /lib/shellwords.rb
parent2d86882ca86ebaaad101d32e8a7c2f30f087e19b (diff)
downloadruby-3288d1e16b2a8532e85bdb5c6029b58109294be5.tar.gz
ruby-3288d1e16b2a8532e85bdb5c6029b58109294be5.tar.xz
ruby-3288d1e16b2a8532e85bdb5c6029b58109294be5.zip
* lib/shellwords.rb (shellwords): A backslash ('\') in single
quotes should not be regarded as meta character. This bug or maybe feature was inherited from Perl's shellwords.pl. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/shellwords.rb')
-rw-r--r--lib/shellwords.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/shellwords.rb b/lib/shellwords.rb
index 9fd757117..6fb40e8a2 100644
--- a/lib/shellwords.rb
+++ b/lib/shellwords.rb
@@ -26,9 +26,8 @@ module Shellwords
snippet.gsub!(/\\(.)/, '\1')
elsif line =~ /\A"/ then #"
raise ArgumentError, "Unmatched double quote: #{line}"
- elsif line.sub!(/\A'(([^'\\]|\\.)*)'/, '') then #'
+ elsif line.sub!(/\A'([^']*)'/, '') then #'
snippet = $1
- snippet.gsub!(/\\(.)/, '\1')
elsif line =~ /\A'/ then #'
raise ArgumentError, "Unmatched single quote: #{line}"
elsif line.sub!(/\A\\(.)/, '') then