aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-06-05 07:35:34 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-06-05 07:35:34 +0000
commitd686a73d917ef73bd969c2085b89114f1a2ed2ea (patch)
tree8851db7cbf84cafd758ed274de1bcfcecd0bc171 /io.c
parent203286673d0c66fdcaf6e65acfa267aaebdc3400 (diff)
downloadruby-d686a73d917ef73bd969c2085b89114f1a2ed2ea.tar.gz
* io.c (rb_f_p): returns arguments to intervene. [ruby-dev:29736]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c11
1 files changed, 9 insertions, 2 deletions
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;
}
/*