1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
knu 2003-01-19 14:13:01 +00:00
parent 02e3fb8cf6
commit 4ae8470a48
2 changed files with 7 additions and 2 deletions

View file

@ -1,3 +1,9 @@
Sun Jan 19 23:08:18 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.
Sat Jan 18 14:53:49 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net> Sat Jan 18 14:53:49 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* bignum.c (rb_cstr_to_inum): should not erase all 0s, but * bignum.c (rb_cstr_to_inum): should not erase all 0s, but

View file

@ -26,9 +26,8 @@ module Shellwords
snippet.gsub!(/\\(.)/, '\1') snippet.gsub!(/\\(.)/, '\1')
elsif line =~ /\A"/ then #" elsif line =~ /\A"/ then #"
raise ArgumentError, "Unmatched double quote: #{line}" raise ArgumentError, "Unmatched double quote: #{line}"
elsif line.sub!(/\A'(([^'\\]|\\.)*)'/, '') then #' elsif line.sub!(/\A'([^']*)'/, '') then #'
snippet = $1 snippet = $1
snippet.gsub!(/\\(.)/, '\1')
elsif line =~ /\A'/ then #' elsif line =~ /\A'/ then #'
raise ArgumentError, "Unmatched single quote: #{line}" raise ArgumentError, "Unmatched single quote: #{line}"
elsif line.sub!(/\A\\(.)/, '') then elsif line.sub!(/\A\\(.)/, '') then