summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-10 07:17:53 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-10 07:17:53 +0000
commit0f66d230c91e9a3640f1ba758ff749952111af2a (patch)
tree75c314d2451167e53fd86dca2039d096e3209802 /lib
parente0b35873aa229ab539a2d18ae5d39d3182093bff (diff)
downloadruby-0f66d230c91e9a3640f1ba758ff749952111af2a.tar.gz
ruby-0f66d230c91e9a3640f1ba758ff749952111af2a.tar.xz
ruby-0f66d230c91e9a3640f1ba758ff749952111af2a.zip
* dir.c (rb_glob2): do not allocate buffer from heap to avoid
memory leaks. use string object for buffering instead. [ruby-dev:24738] * dir.c (join_path): ditto. * io.c (io_read): external input buffer may be modified even after rb_str_locktmp(). [ruby-dev:24735] * dir.c (fnmatch): p or s may be NULL. [ruby-dev:24749] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/shellwords.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/shellwords.rb b/lib/shellwords.rb
index 99c0bf843..e87b9e656 100644
--- a/lib/shellwords.rb
+++ b/lib/shellwords.rb
@@ -41,8 +41,8 @@ module Shellwords
snippet = $1
elsif line =~ /\A'/ then
raise ArgumentError, "Unmatched single quote: #{line}"
- elsif line.sub!(/\A\\(.)/, '') then
- snippet = $1
+ elsif line.sub!(/\A\\(.)?/, '') then
+ snippet = $1 || '\\'
elsif line.sub!(/\A([^\s\\'"]+)/, '') then
snippet = $1
else