aboutsummaryrefslogtreecommitdiffstats
path: root/lib/shellwords.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/shellwords.rb')
-rw-r--r--lib/shellwords.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/shellwords.rb b/lib/shellwords.rb
index a83d1f1c86..20ddfe2646 100644
--- a/lib/shellwords.rb
+++ b/lib/shellwords.rb
@@ -41,7 +41,7 @@ module Shellwords
line.scan(/\G\s*(?>([^\s\\\'\"]+)|'([^\']*)'|"((?:[^\"\\]|\\.)*)"|(\\.?)|(\S))(\s|\z)?/m) do
|word, sq, dq, esc, garbage, sep|
raise ArgumentError, "Unmatched double quote: #{line.inspect}" if garbage
- field << (word || sq || (dq || esc).gsub(/\\(?=.)/, ''))
+ field << (word || sq || (dq || esc).gsub(/\\(.)/, '\\1'))
if sep
words << field
field = ''