summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-11-22 14:53:16 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-11-22 14:53:16 +0000
commite8a83b54cb2321c3b6de9ea2f3df81064a1b18f7 (patch)
tree4d5ebc1bb20ad76f07d8d314de8732d58a23831e /lib
parentabcbaa5c6fb2b5e5b02b255044f6ddda94a6fcd5 (diff)
* lib/optparse.rb: match incomplete (in current enconding) multibyte
string. http://inamode6.tokuhirom.dnsalias.org/show/1551 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/optparse.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/optparse.rb b/lib/optparse.rb
index c056ac8d25..966de0ed68 100644
--- a/lib/optparse.rb
+++ b/lib/optparse.rb
@@ -533,7 +533,7 @@ class OptionParser
#
# See OptionParser.accept.
#
- def accept(t, pat = /.*/, &block)
+ def accept(t, pat = /.*/nm, &block)
if pat
pat.respond_to?(:match) or raise TypeError, "has no `match'"
else
@@ -1310,7 +1310,7 @@ class OptionParser
while arg = argv.shift
case arg
# long option
- when /\A--([^=]*)(?:=(.*))?/
+ when /\A--([^=]*)(?:=(.*))?/nm
opt, rest = $1, $2
begin
sw, = complete(:long, opt, true)
@@ -1325,7 +1325,7 @@ class OptionParser
end
# short option
- when /\A-(.)((=).*|.+)?/
+ when /\A-(.)((=).*|.+)?/nm
opt, has_arg, eq, val, rest = $1, $3, $3, $2, $2
begin
unless sw = search(:short, opt)
@@ -1545,7 +1545,7 @@ class OptionParser
: String
any none-empty string, and no conversion.
=end #'#"#`#
- accept(String, /.+/) {|s,*|s}
+ accept(String, /.+/nm) {|s,*|s}
=begin
: Integer