diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-08-01 09:25:37 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-08-01 09:25:37 +0000 |
commit | d3a61700106dbb79ff2330517187ff04df63fdb7 () | |
tree | ebd326e315572f9712a37a81ab46c35dea88f1b5 /lib/shellwords.rb | |
parent | 65cdbd0667ae56198e8ebd7b2b06a6a35c14b718 (diff) |
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | lib/shellwords.rb | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -16,27 +16,27 @@ module Shellwords unless line.kind_of?(String) raise ArgumentError, "Argument must be String class object." end - line.sub!(/^\s+/, '') words = [] while line != '' field = '' while true - if line.sub!(/^"(([^"\\]|\\.)*)"/, '') then #" snippet = $1 snippet.gsub!(/\\(.)/, '\1') - elsif line =~ /^"/ then #" raise ArgumentError, "Unmatched double quote: #{line}" - elsif line.sub!(/^'(([^'\\]|\\.)*)'/, '') then #' snippet = $1 snippet.gsub!(/\\(.)/, '\1') - elsif line =~ /^'/ then #' raise ArgumentError, "Unmatched single quote: #{line}" - elsif line.sub!(/^\\(.)/, '') then snippet = $1 - elsif line.sub!(/^([^\s\\'"]+)/, '') then #' snippet = $1 else - line.sub!(/^\s+/, '') break end field.concat(snippet) |