public
Description: ruby lang (www.ruby-lang.org) svn mirror
Homepage: http://svn.ruby-lang.org/repos/ruby/
Clone URL: git://github.com/juretta/ruby.git
Search Repo:
* io.c (argf_set_encoding): uses current_file after check for next
  input.


git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15561 
b2dd03c8-39d4-4d8f-98ff-823fe69b080e
nobu (author)
Wed Feb 20 21:47:12 -0800 2008
commit  31e7747b6bcd6e13a60848f51dcd71d154778d67
tree    b724185f18f370755cb8264d89b205881cd8f4bb
parent  370ed6a27156bc782bf173fa7aa5a17562215e5e
...
 
 
 
 
 
1
2
3
...
1
2
3
4
5
6
7
8
0
@@ -1,3 +1,8 @@
0
+Thu Feb 21 14:47:09 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
0
+
0
+ * io.c (argf_set_encoding): uses current_file after check for next
0
+ input.
0
+
0
 Thu Feb 21 11:10:49 2008 NARUSE, Yui <naruse@ruby-lang.org>
0
 
0
   * string.c: replace rb_enc_copy by rb_enc_cr_str_copy or
...
69
70
71
 
 
 
 
...
69
70
71
72
73
74
75
0
@@ -69,3 +69,7 @@ assert_equal 'ok', %q{
0
   File.unlink(tmpname)
0
   :ok
0
 }
0
+
0
+assert_normal_exit %q{
0
+ ARGF.set_encoding "foo"
0
+}
...
57
58
59
60
61
62
63
...
57
58
59
 
 
 
 
0
@@ -57,7 +57,3 @@ assert_normal_exit %q{
0
 assert_normal_exit %q{
0
   "".center(1, "\x80".force_encoding("utf-8"))
0
 }, '[ruby-dev:33807]'
0
-
0
-assert_normal_exit %q{
0
- ARGF.set_encoding "foo"
0
-}
0
...
6103
6104
6105
 
 
 
6106
6107
 
6108
6109
6110
...
6103
6104
6105
6106
6107
6108
6109
 
6110
6111
6112
6113
0
@@ -6103,8 +6103,11 @@ argf_set_encoding(int argc, VALUE *argv, VALUE io)
0
 {
0
     rb_io_t *fptr;
0
 
0
+ if (next_argv()) {
0
+ rb_raise(rb_eArgError, "no stream to set encoding");
0
+ }
0
     rb_io_set_encoding(argc, argv, current_file);
0
- GetOpenFile(io, fptr);
0
+ GetOpenFile(current_file, fptr);
0
     argf_enc = fptr->enc;
0
     argf_enc2 = fptr->enc2;
0
     return io;

Comments

    No one has commented yet.