summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--eval.c3
-rw-r--r--io.c3
-rw-r--r--lib/cgi.rb8
4 files changed, 15 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index d57d563c12..9fa2396c5e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -54,6 +54,11 @@ Sat Jun 28 12:28:46 2003 Nobuyoshi Nakada <[email protected]>
* gc.c (Init_stack): add safety margin.
+Sat Jun 14 17:59:59 2003 Guy Decoux <[email protected]>
+
+ * eval.c (method_arity): should handle NODE_BMETHOD and
+ NODE_DMETHOD. [ruby-core:01138]
+
Fri May 30 11:25:58 2003 WATANABE Hirofumi <[email protected]>
* lib/irb/xmp.rb: sync with 1.8 ("irb/irb" -> "irb").
diff --git a/eval.c b/eval.c
index c0dc3173dd..d97386992c 100644
--- a/eval.c
+++ b/eval.c
@@ -6827,6 +6827,9 @@ method_arity(method)
return INT2FIX(1);
case NODE_IVAR:
return INT2FIX(0);
+ case NODE_BMETHOD:
+ case NODE_DMETHOD:
+ return proc_arity(method);
default:
body = body->nd_next; /* skip NODE_SCOPE */
if (nd_type(body) == NODE_BLOCK)
diff --git a/io.c b/io.c
index 8d6796795c..a97238e714 100644
--- a/io.c
+++ b/io.c
@@ -2184,7 +2184,8 @@ rb_io_puts(argc, argv, out)
line = rb_obj_as_string(argv[i]);
}
rb_io_write(out, line);
- if (RSTRING(line)->ptr[RSTRING(line)->len-1] != '\n') {
+ if (RSTRING(line)->len == 0 ||
+ RSTRING(line)->ptr[RSTRING(line)->len-1] != '\n') {
rb_io_write(out, rb_default_rs);
}
}
diff --git a/lib/cgi.rb b/lib/cgi.rb
index 714a3a2099..5987d9b03f 100644
--- a/lib/cgi.rb
+++ b/lib/cgi.rb
@@ -823,13 +823,15 @@ convert string charset, and set language to "ja".
end
c = if bufsize < content_length
- stdinput.read(bufsize) or ''
+ stdinput.read(bufsize)
else
- stdinput.read(content_length) or ''
+ stdinput.read(content_length)
end
+ if c.nil?
+ raise EOFError, "bad content body"
+ end
buf += c
content_length -= c.size
-
end
buf = buf.sub(/\A((?:.|\n)*?)(?:#{EOL})?#{boundary}(#{EOL}|--)/n) do