diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | parse.y | 4 |
2 files changed, 7 insertions, 1 deletions
@@ -1,3 +1,7 @@ +Fri Jan 18 20:19:51 2008 NAKAMURA Usaku <usa@ruby-lang.org> + + * parse.y (ripper_initialize): too early to set parser->enc. + Fri Jan 18 20:03:05 2008 NAKAMURA Usaku <usa@ruby-lang.org> * win32/setup.mak (BASERUBY): nmake cannot execute ruby collectly @@ -9677,7 +9677,6 @@ ripper_initialize(int argc, VALUE *argv, VALUE self) else { StringValue(src); parser->parser_lex_gets = lex_get_str; - parser->enc = rb_enc_get(src); } parser->parser_lex_input = src; parser->eofp = Qfalse; @@ -9690,6 +9689,9 @@ ripper_initialize(int argc, VALUE *argv, VALUE self) rb_str_append(fname2, fname); } parser_initialize(parser); + if (parser->parser_lex_gets == lex_get_str) { + parser->enc = rb_enc_get(src); + } parser->parser_ruby_sourcefile_string = fname2; parser->parser_ruby_sourcefile = RSTRING_PTR(fname2)+1; |