diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-11-22 14:53:16 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-11-22 14:53:16 +0000 |
| commit | 1670586349ea030907464248d63875ecbe5a105f (patch) | |
| tree | 79ca2da79c0bd8e77d77eca5857cf1561e28b1da /lib/optparse.rb | |
| parent | 6fff1301bdaef778b57d60a01fd23b090d248692 (diff) | |
| download | ruby-1670586349ea030907464248d63875ecbe5a105f.tar.gz ruby-1670586349ea030907464248d63875ecbe5a105f.tar.xz ruby-1670586349ea030907464248d63875ecbe5a105f.zip | |
* lib/optparse.rb: match incomplete (in current enconding) multibyte
string. http://inamode6.tokuhirom.dnsalias.org/show/1551
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/optparse.rb')
| -rw-r--r-- | lib/optparse.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/optparse.rb b/lib/optparse.rb index 6668f30c8..b6ee6c896 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 |
