summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-12-10 06:23:44 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-12-10 06:23:44 +0000
commit60b2446bea0297c47f56deb308c29a5c1af64cc9 (patch)
tree2bcb6184518b5e93ec49a03b275258a817511abd /io.c
parent4dcd8a95c7acf13a87283c11f72f7a8a7ad15019 (diff)
* sprintf.c (rb_f_sprintf): preceding ".." for negative numbers
still left; removed. * sprintf.c (rb_f_sprintf): should not prepend '0' if width > prec for example "%5.3d". * process.c (Init_process): add Process.exit and Process.abort * pack.c (utf8_to_uv): raise ArgumentError for malformed/redundant UTF-8 sequences. * process.c (last_status_set): add pid attribute to Process::Status. * pack.c (uv_to_utf8): limit maximum length of the encoded string to 6 bytes, even when the platform supports 8 bytes long integers. * pack.c (utf8_to_uv): do not decode sequences longer than 6 bytes. * object.c (copy_object): use "copy_object" method, not "become". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/io.c b/io.c
index 5eecc94c34..b34c988389 100644
--- a/io.c
+++ b/io.c
@@ -2376,17 +2376,17 @@ rb_io_reopen(argc, argv, file)
}
static VALUE
-rb_io_become(clone, io)
- VALUE clone, io;
+rb_io_copy_object(dest, io)
+ VALUE dest, io;
{
OpenFile *fptr, *orig;
int fd;
char *mode;
io = rb_io_get_io(io);
- if (clone == io) return clone;
+ if (dest == io) return dest;
GetOpenFile(io, orig);
- MakeOpenFile(clone, fptr);
+ MakeOpenFile(dest, fptr);
if (orig->f2) {
io_fflush(orig->f2, orig);
@@ -2422,10 +2422,10 @@ rb_io_become(clone, io)
fptr->f2 = rb_fdopen(fd, "w");
}
if (fptr->mode & FMODE_BINMODE) {
- rb_io_binmode(clone);
+ rb_io_binmode(dest);
}
- return clone;
+ return dest;
}
VALUE
@@ -3906,7 +3906,7 @@ Init_IO()
rb_define_hooked_variable("$.", &lineno, 0, lineno_setter);
rb_define_virtual_variable("$_", rb_lastline_get, rb_lastline_set);
- rb_define_method(rb_cIO, "become", rb_io_become, 1);
+ rb_define_method(rb_cIO, "copy_object", rb_io_copy_object, 1);
rb_define_method(rb_cIO, "reopen", rb_io_reopen, -1);
rb_define_method(rb_cIO, "print", rb_io_print, -1);