Permalink
Browse files

* 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/branches/ruby_1_6@3357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent 0d5e1da commit c7e536799ecb7cf929af82b0e5db9f3cbe3c18c8 @knu knu committed Jan 19, 2003
Showing with 7 additions and 2 deletions.
  1. +6 −0 ChangeLog
  2. +1 −2 lib/shellwords.rb
View
6 ChangeLog
@@ -1,3 +1,9 @@
+Sun Jan 19 23:12:21 2003 Akinori MUSHA <knu@iDaemons.org>
+
+ * 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.
+
Fri Jan 17 03:33:42 2003 Akinori MUSHA <knu@iDaemons.org>
* sprintf.c (rb_f_sprintf): Fix a bug caused by an uninitialized
View
3 lib/shellwords.rb
@@ -26,9 +26,8 @@ def shellwords(line)
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

0 comments on commit c7e5367

Please sign in to comment.