Skip to content

Commit 2e71945

Browse files
author
matz
committed
* eval.c (method_arity): should handle NODE_BMETHOD and
NODE_DMETHOD. [ruby-core:01138] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@7110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent bde7efb commit 2e71945

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ Sat Jun 28 12:28:46 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
5454

5555
* gc.c (Init_stack): add safety margin.
5656

57+
Sat Jun 14 17:59:59 2003 Guy Decoux <ts@moulon.inra.fr>
58+
59+
* eval.c (method_arity): should handle NODE_BMETHOD and
60+
NODE_DMETHOD. [ruby-core:01138]
61+
5762
Fri May 30 11:25:58 2003 WATANABE Hirofumi <eban@ruby-lang.org>
5863

5964
* lib/irb/xmp.rb: sync with 1.8 ("irb/irb" -> "irb").

eval.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6827,6 +6827,9 @@ method_arity(method)
68276827
return INT2FIX(1);
68286828
case NODE_IVAR:
68296829
return INT2FIX(0);
6830+
case NODE_BMETHOD:
6831+
case NODE_DMETHOD:
6832+
return proc_arity(method);
68306833
default:
68316834
body = body->nd_next; /* skip NODE_SCOPE */
68326835
if (nd_type(body) == NODE_BLOCK)

io.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2184,7 +2184,8 @@ rb_io_puts(argc, argv, out)
21842184
line = rb_obj_as_string(argv[i]);
21852185
}
21862186
rb_io_write(out, line);
2187-
if (RSTRING(line)->ptr[RSTRING(line)->len-1] != '\n') {
2187+
if (RSTRING(line)->len == 0 ||
2188+
RSTRING(line)->ptr[RSTRING(line)->len-1] != '\n') {
21882189
rb_io_write(out, rb_default_rs);
21892190
}
21902191
}

lib/cgi.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -823,13 +823,15 @@ def read_multipart(boundary, content_length)
823823
end
824824

825825
c = if bufsize < content_length
826-
stdinput.read(bufsize) or ''
826+
stdinput.read(bufsize)
827827
else
828-
stdinput.read(content_length) or ''
828+
stdinput.read(content_length)
829829
end
830+
if c.nil?
831+
raise EOFError, "bad content body"
832+
end
830833
buf += c
831834
content_length -= c.size
832-
833835
end
834836

835837
buf = buf.sub(/\A((?:.|\n)*?)(?:#{EOL})?#{boundary}(#{EOL}|--)/n) do

0 commit comments

Comments
 (0)