summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-11-08 05:29:37 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-11-08 05:29:37 +0000
commitaf328b152b68bb21549e52df230b17a8672795c3 (patch)
tree8a63998435ddc0a3367124967bf063f01e7cfbb9 /lib
parent41e41d34d14ef3595a54148368b89b6c75d0fe4d (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/jcode.rb6
-rw-r--r--lib/open3.rb2
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/jcode.rb b/lib/jcode.rb
index 0f53b7185b..3ce692fc50 100644
--- a/lib/jcode.rb
+++ b/lib/jcode.rb
@@ -5,8 +5,8 @@ class String
printf STDERR, "feel free for some warnings:\n" if $VERBOSE
def _regex_quote(str)
- str.gsub(/\W/){|s|
- if s == "-" then s elsif s == "\\" then "\\\\" else "\\\\#{s}" end
+ str.gsub(/[][.\\|*?+{}()]/n){|s|
+ if s == "\\" then "\\\\" else "\\\\#{s}" end
}
end
private :_regex_quote
@@ -93,7 +93,7 @@ class String
def _expand_ch str
a = []
- str.scan(/(.|\n)-(.|\n)|(.|\n)/) do |r|
+ str.scan(/(.)-(.)|(.)/m) do |r|
if $3
a.push $3
elsif $1.length != $2.length
diff --git a/lib/open3.rb b/lib/open3.rb
index 18984f5726..58de740393 100644
--- a/lib/open3.rb
+++ b/lib/open3.rb
@@ -41,7 +41,7 @@ module Open3
pi = [pw[1], pr[0], pe[0]]
if defined? yield
begin
- return yield *pi
+ return yield(*pi)
ensure
pi.each{|p| p.close unless p.closed?}
end