summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-07-03 07:06:51 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-07-03 07:06:51 +0000
commitab801dbdb7ff8a99b5e0976516b879b27bcf3e1b (patch)
tree2657a1ca78c166beda5dfb609f9c53c5bae6f85c /io.c
parent1a2003d1f176001f4c691d14a080e722bb12fc7b (diff)
1.1b9_29
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/io.c b/io.c
index 8349da0be8..826c0f0238 100644
--- a/io.c
+++ b/io.c
@@ -512,7 +512,10 @@ io_gets_method(argc, argv, io)
TRAP_BEG;
c = getc(f);
TRAP_END;
- if (c == EOF) break;
+ if (c == EOF) {
+ if (errno == EINTR) continue;
+ break;
+ }
if ((*bp++ = c) == newline) break;
if (bp == bpe) break;
}
@@ -599,7 +602,10 @@ io_gets(io)
TRAP_BEG;
c = getc(f);
TRAP_END;
- if (c == EOF) break;
+ if (c == EOF) {
+ if (errno == EINTR) continue;
+ break;
+ }
if ((*bp++ = c) == '\n') break;
if (bp == bpe) break;
}
@@ -1599,21 +1605,25 @@ f_puts(argc, argv)
return Qnil;
}
-static VALUE
-f_p(self, obj)
- VALUE self, obj;
+void
+rb_p(obj) /* for debug print within C code */
+ VALUE obj;
{
io_write(rb_defout, rb_inspect(obj));
io_write(rb_defout, RS_default);
-
- return Qnil;
}
-void
-rb_p(obj) /* for debug print within C code */
- VALUE obj;
+static VALUE
+f_p(argc, argv)
+ int argc;
+ VALUE *argv;
{
- f_p(0, obj);
+ int i;
+
+ for (i=0; i<argc; i++) {
+ rb_p(argv[i]);
+ }
+ return Qnil;
}
static VALUE
@@ -2607,7 +2617,7 @@ Init_IO()
rb_define_global_function("`", f_backquote, 1);
rb_define_global_function("pipe", io_s_pipe, 0);
- rb_define_global_function("p", f_p, 1);
+ rb_define_global_function("p", f_p, -1);
rb_define_method(mKernel, "display", obj_display, -1);
cIO = rb_define_class("IO", cObject);