mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
4dc782978d
commit
d1f1aa820f
2 changed files with 9 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Tue Nov 22 23:52:06 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/optparse.rb: match incomplete (in current enconding) multibyte
|
||||||
|
string. http://inamode6.tokuhirom.dnsalias.org/show/1551
|
||||||
|
|
||||||
Tue Nov 22 18:36:11 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
|
Tue Nov 22 18:36:11 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
|
||||||
|
|
||||||
* win32/win32.c (winnt_stat): set mapped errno instead of ENOENT.
|
* win32/win32.c (winnt_stat): set mapped errno instead of ENOENT.
|
||||||
|
|
|
@ -521,7 +521,7 @@ class OptionParser
|
||||||
#
|
#
|
||||||
# See OptionParser.accept.
|
# See OptionParser.accept.
|
||||||
#
|
#
|
||||||
def accept(t, pat = /.*/, &block)
|
def accept(t, pat = /.*/nm, &block)
|
||||||
if pat
|
if pat
|
||||||
pat.respond_to?(:match) or raise TypeError, "has no `match'"
|
pat.respond_to?(:match) or raise TypeError, "has no `match'"
|
||||||
else
|
else
|
||||||
|
@ -1272,7 +1272,7 @@ class OptionParser
|
||||||
while arg = argv.shift
|
while arg = argv.shift
|
||||||
case arg
|
case arg
|
||||||
# long option
|
# long option
|
||||||
when /\A--([^=]*)(?:=(.*))?/
|
when /\A--([^=]*)(?:=(.*))?/nm
|
||||||
opt, rest = $1, $2
|
opt, rest = $1, $2
|
||||||
begin
|
begin
|
||||||
sw, = complete(:long, opt, true)
|
sw, = complete(:long, opt, true)
|
||||||
|
@ -1287,7 +1287,7 @@ class OptionParser
|
||||||
end
|
end
|
||||||
|
|
||||||
# short option
|
# short option
|
||||||
when /\A-(.)((=).*|.+)?/
|
when /\A-(.)((=).*|.+)?/nm
|
||||||
opt, has_arg, eq, val, rest = $1, $3, $3, $2, $2
|
opt, has_arg, eq, val, rest = $1, $3, $3, $2, $2
|
||||||
begin
|
begin
|
||||||
unless sw = search(:short, opt)
|
unless sw = search(:short, opt)
|
||||||
|
@ -1500,7 +1500,7 @@ class OptionParser
|
||||||
: String
|
: String
|
||||||
any none-empty string, and no conversion.
|
any none-empty string, and no conversion.
|
||||||
=end #'#"#`#
|
=end #'#"#`#
|
||||||
accept(String, /.+/) {|s,*|s}
|
accept(String, /.+/nm) {|s,*|s}
|
||||||
|
|
||||||
=begin
|
=begin
|
||||||
: Integer
|
: Integer
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue