From 9e77e91a13a8ae1d8bb4bba8974da390fbadedc0 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 6 Jun 2003 09:24:59 +0000 Subject: * eval.c (ruby_cleanup): $SAFE is turned off in the finalization. Each END proc should preserve its own $SAFE level. [ruby-core:01119] * marshal.c (marshal_load): remove unused variable "hash". [ruby-core:01120] * hash.c (env_str_new): freeze strings from ENV. [ruby-talk:72860] * array.c (rb_ary_first): optional argument to retrieve first n elements. * array.c (rb_ary_last): optional argument to retrieve last n elements. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'io.c') diff --git a/io.c b/io.c index e5504b02da..79c2ea3461 100644 --- a/io.c +++ b/io.c @@ -411,12 +411,12 @@ io_write(io, str) rb_secure(4); if (TYPE(str) != T_STRING) str = rb_obj_as_string(str); - if (RSTRING(str)->len == 0) return INT2FIX(0); if (TYPE(io) != T_FILE) { /* port is not IO, call write method for it. */ return rb_funcall(io, id_write, 1, str); } + if (RSTRING(str)->len == 0) return INT2FIX(0); GetOpenFile(io, fptr); rb_io_check_writable(fptr); -- cgit v1.2.3