summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-04-10 05:48:43 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-04-10 05:48:43 +0000
commit7194267b3bdf68ad75bd6bee8e7c6377f7b0ea2f (patch)
tree6dcd08ef584fc777cf34517136d5ce3948840e45 /io.c
parentbe72d9a5da9be284d2bdb8047e50f14e014b7835 (diff)
2000-04-10
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/io.c b/io.c
index 82b611805a..b249ef839e 100644
--- a/io.c
+++ b/io.c
@@ -1799,7 +1799,7 @@ rb_io_reopen(argc, argv, file)
rb_secure(4);
if (rb_scan_args(argc, argv, "11", &fname, &nmode) == 1) {
- if (TYPE(fname) == T_FILE) { /* fname must be IO */
+ if (TYPE(fname) != T_STRING) { /* fname must be IO */
return io_reopen(file, fname);
}
}
@@ -1895,7 +1895,7 @@ rb_io_printf(argc, argv, out)
VALUE argv[];
VALUE out;
{
- io_write(out, rb_f_sprintf(argc, argv));
+ rb_io_write(out, rb_f_sprintf(argc, argv));
return Qnil;
}
@@ -1915,7 +1915,7 @@ rb_f_printf(argc, argv)
argv++;
argc--;
}
- io_write(out, rb_f_sprintf(argc, argv));
+ rb_io_write(out, rb_f_sprintf(argc, argv));
return Qnil;
}
@@ -2334,8 +2334,7 @@ next_argv()
#if defined(MSDOS) || defined(__CYGWIN__) || defined(NT)
ruby_add_suffix(str, ruby_inplace_mode);
#else
- rb_str_cat(str, ruby_inplace_mode,
- strlen(ruby_inplace_mode));
+ rb_str_cat2(str, ruby_inplace_mode);
#endif
#if defined(MSDOS) || defined(__BOW__) || defined(__CYGWIN__) || defined(NT) || defined(__human68k__) || defined(__EMX__)
(void)fclose(fr);
@@ -3063,7 +3062,7 @@ argf_read(argc, argv)
}
if (NIL_P(tmp) || RSTRING(tmp)->len == 0) return str;
else if (NIL_P(str)) str = tmp;
- else rb_str_cat(str, RSTRING(tmp)->ptr, RSTRING(tmp)->len);
+ else rb_str_append(str, tmp);
if (argc == 0) {
goto retry;
}