mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
fix that arg_check didn't work
* lib/uri/ftp.rb (initialize): arg[-1] was fragment, but it must be arg_check. * lib/uri/ftp.rb (initialize): explicitly specify arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f977ebb1c9
commit
c56dab2ceb
2 changed files with 21 additions and 7 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
Sun Jun 22 09:01:47 2014 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/uri/ftp.rb (initialize): argument checking flag is arg_check,
|
||||||
|
but arg[-1] is fragment.
|
||||||
|
|
||||||
|
* lib/uri/ftp.rb (initialize): explicitly specify arguments.
|
||||||
|
|
||||||
Sat Jun 21 12:50:32 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Sat Jun 21 12:50:32 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* ext/fiddle/extconf.rb: supply 0 to fill RUBY_LIBFFI_MODVERSION
|
* ext/fiddle/extconf.rb: supply 0 to fill RUBY_LIBFFI_MODVERSION
|
||||||
|
|
|
@ -129,17 +129,24 @@ module URI
|
||||||
# Arguments are +scheme+, +userinfo+, +host+, +port+, +registry+, +path+,
|
# Arguments are +scheme+, +userinfo+, +host+, +port+, +registry+, +path+,
|
||||||
# +opaque+, +query+ and +fragment+, in that order.
|
# +opaque+, +query+ and +fragment+, in that order.
|
||||||
#
|
#
|
||||||
def initialize(*arg)
|
def initialize(scheme,
|
||||||
raise InvalidURIError unless arg[5]
|
userinfo, host, port, registry,
|
||||||
arg[5] = arg[5].sub(/^\//,'').sub(/^%2F/,'/')
|
path, opaque,
|
||||||
super(*arg)
|
query,
|
||||||
|
fragment,
|
||||||
|
parser = nil,
|
||||||
|
arg_check = false)
|
||||||
|
raise InvalidURIError unless path
|
||||||
|
path = path.sub(/^\//,'')
|
||||||
|
path.sub!(/^%2F/,'/')
|
||||||
|
super(scheme, userinfo, host, port, registry, path, opaque,
|
||||||
|
query, fragment, parser, arg_check)
|
||||||
@typecode = nil
|
@typecode = nil
|
||||||
tmp = @path.index(TYPECODE_PREFIX)
|
if tmp = @path.index(TYPECODE_PREFIX)
|
||||||
if tmp
|
|
||||||
typecode = @path[tmp + TYPECODE_PREFIX.size..-1]
|
typecode = @path[tmp + TYPECODE_PREFIX.size..-1]
|
||||||
@path = @path[0..tmp - 1]
|
@path = @path[0..tmp - 1]
|
||||||
|
|
||||||
if arg[-1]
|
if arg_check
|
||||||
self.typecode = typecode
|
self.typecode = typecode
|
||||||
else
|
else
|
||||||
self.set_typecode(typecode)
|
self.set_typecode(typecode)
|
||||||
|
|
Loading…
Add table
Reference in a new issue