summaryrefslogtreecommitdiff
path: root/lib/optparse.rb
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
commitd1f1aa820f6367af03686252ccb7c43f325e7b43 (patch)
tree79ca2da79c0bd8e77d77eca5857cf1561e28b1da /lib/optparse.rb
parent4dc782978d899f83d506f75ce22a5bd72d7296a5 (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/branches/ruby_1_8@9589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/optparse.rb')
-rw-r--r--lib/optparse.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/optparse.rb b/lib/optparse.rb
index 6668f30c8b..b6ee6c896c 100644
--- a/lib/optparse.rb
+++ b/lib/optparse.rb
@@ -521,7 +521,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
@@ -1272,7 +1272,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)
@@ -1287,7 +1287,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)
@@ -1500,7 +1500,7 @@ class OptionParser
: String
any none-empty string, and no conversion.
=end #'#"#`#
- accept(String, /.+/) {|s,*|s}
+ accept(String, /.+/nm) {|s,*|s}
=begin
: Integer