ruby-changes:4071
From: ko1@a...
Date: Thu, 21 Feb 2008 14:47:35 +0900 (JST)
Subject: [ruby-changes:4071] nobu - Ruby:r15561 (trunk): * io.c (argf_set_encoding): uses current_file after check for next
nobu 2008-02-21 14:47:12 +0900 (Thu, 21 Feb 2008)
New Revision: 15561
Modified files:
trunk/ChangeLog
trunk/bootstraptest/test_io.rb
trunk/bootstraptest/test_knownbug.rb
trunk/io.c
Log:
* io.c (argf_set_encoding): uses current_file after check for next
input.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/bootstraptest/test_io.rb?r1=15561&r2=15560&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=15561&r2=15560&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/io.c?r1=15561&r2=15560&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/bootstraptest/test_knownbug.rb?r1=15561&r2=15560&diff_format=u
Index: ChangeLog
===================================================================
--- ChangeLog (revision 15560)
+++ ChangeLog (revision 15561)
@@ -1,3 +1,8 @@
+Thu Feb 21 14:47:09 2008 Nobuyoshi Nakada <nobu@r...>
+
+ * io.c (argf_set_encoding): uses current_file after check for next
+ input.
+
Thu Feb 21 11:10:49 2008 NARUSE, Yui <naruse@r...>
* string.c: replace rb_enc_copy by rb_enc_cr_str_copy or
Index: bootstraptest/test_knownbug.rb
===================================================================
--- bootstraptest/test_knownbug.rb (revision 15560)
+++ bootstraptest/test_knownbug.rb (revision 15561)
@@ -57,7 +57,3 @@
assert_normal_exit %q{
"".center(1, "\x80".force_encoding("utf-8"))
}, '[ruby-dev:33807]'
-
-assert_normal_exit %q{
- ARGF.set_encoding "foo"
-}
Index: bootstraptest/test_io.rb
===================================================================
--- bootstraptest/test_io.rb (revision 15560)
+++ bootstraptest/test_io.rb (revision 15561)
@@ -69,3 +69,7 @@
File.unlink(tmpname)
:ok
}
+
+assert_normal_exit %q{
+ ARGF.set_encoding "foo"
+}
Index: io.c
===================================================================
--- io.c (revision 15560)
+++ io.c (revision 15561)
@@ -6103,8 +6103,11 @@
{
rb_io_t *fptr;
+ if (next_argv()) {
+ rb_raise(rb_eArgError, "no stream to set encoding");
+ }
rb_io_set_encoding(argc, argv, current_file);
- GetOpenFile(io, fptr);
+ GetOpenFile(current_file, fptr);
argf_enc = fptr->enc;
argf_enc2 = fptr->enc2;
return io;
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/