[前][次][番号順一覧][スレッド一覧]

ruby-changes:2251

From: ko1@a...
Date: 19 Oct 2007 11:36:31 +0900
Subject: [ruby-changes:2251] nobu - Ruby:r13742 (trunk): * ruby.c (process_options): set primary encoding from the parser

nobu	2007-10-19 11:09:57 +0900 (Fri, 19 Oct 2007)

  New Revision: 13742

  Modified files:
    trunk/ChangeLog
    trunk/ruby.c

  Log:
    * ruby.c (process_options): set primary encoding from the parser
      always.  [ruby-core:12758]
    
    * ruby.c (load_file): should not discard the parser parameter.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ruby.c?r1=13742&r2=13741
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=13742&r2=13741

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 13741)
+++ ChangeLog	(revision 13742)
@@ -1,3 +1,10 @@
+Fri Oct 19 11:09:56 2007  Nobuyoshi Nakada  <nobu@r...>
+
+	* ruby.c (process_options): set primary encoding from the parser
+	  always.  [ruby-core:12758]
+
+	* ruby.c (load_file): should not discard the parser parameter.
+
 Fri Oct 19 10:55:42 2007  Nobuyoshi Nakada  <nobu@r...>
 
 	* range.c (range_last): removed unused variables.
Index: ruby.c
===================================================================
--- ruby.c	(revision 13741)
+++ ruby.c	(revision 13742)
@@ -842,7 +842,6 @@
     char **argv = opt->argv;
     NODE *tree = 0;
     VALUE parser;
-    VALUE encoding;
     const char *s;
     int i = proc_options(argc, argv, opt);
 
@@ -970,13 +969,7 @@
 	}
     }
 
-    if (opt->enc_index >= 0) {
-	encoding = rb_enc_from_encoding(rb_enc_from_index(opt->enc_index));
-    }
-    else {
-	encoding = rb_parser_encoding(parser);
-    }
-    rb_set_primary_encoding(encoding);
+    rb_set_primary_encoding(rb_parser_encoding(parser));
 
     return (VALUE)tree;
 }
@@ -1097,7 +1090,6 @@
 	require_libraries();	/* Why here? unnatural */
     }
     if (opt->enc_index >= 0) rb_enc_associate_index(f, opt->enc_index);
-    parser = rb_parser_new();
     tree = (NODE *)rb_parser_compile_file(parser, fname, f, line_start);
     if (script && rb_parser_end_seen_p(parser)) {
 	rb_define_global_const("DATA", f);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml

[前][次][番号順一覧][スレッド一覧]