From 4ae8470a48e9491ccccb6f989f0481aa8e8c8e78 Mon Sep 17 00:00:00 2001 From: knu Date: Sun, 19 Jan 2003 14:13:01 +0000 Subject: * 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@3357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/shellwords.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/shellwords.rb b/lib/shellwords.rb index 9fd7571172..6fb40e8a27 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 -- cgit v1.2.3