aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--io.c11
2 files changed, 13 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index ea7c2ee6d4..acaa1dd9ae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Tue Jun 5 16:30:38 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * io.c (rb_f_p): returns arguments to intervene. [ruby-dev:29736]
+
Tue Jun 5 14:07:55 2007 Koichi Sasada <ko1@atdot.net>
* insns.def (invokeblock): check block is created by lambda
diff --git a/io.c b/io.c
index c1f6b0922b..84c6b87cfa 100644
--- a/io.c
+++ b/io.c
@@ -3980,17 +3980,24 @@ rb_p(VALUE obj) /* for debug print within C code */
*/
static VALUE
-rb_f_p(int argc, VALUE *argv)
+rb_f_p(int argc, VALUE *argv, VALUE self)
{
int i;
+ VALUE ret = Qnil;
for (i=0; i<argc; i++) {
rb_p(argv[i]);
}
+ if (argc == 1) {
+ ret = argv[0];
+ }
+ else {
+ ret = rb_ary_new4(argc, argv);
+ }
if (TYPE(rb_stdout) == T_FILE) {
rb_io_flush(rb_stdout);
}
- return Qnil;
+ return ret;
}
/*