1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ruby.c (load_file): set default to ASCII-8BIT explicitly if -K

option is not given.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-01-25 08:12:15 +00:00
parent 1e41069754
commit a984e00b80
2 changed files with 7 additions and 4 deletions

View file

@ -1,3 +1,8 @@
Fri Jan 25 17:12:13 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ruby.c (load_file): set default to ASCII-8BIT explicitly if -K
option is not given.
Fri Jan 25 16:31:47 2008 Tanaka Akira <akr@fsij.org>
* include/ruby/intern.h (rb_str_buf_cat_ascii): declared.

6
ruby.c
View file

@ -1207,11 +1207,9 @@ load_file(VALUE parser, const char *fname, int script, struct cmdline_options *o
}
}
else {
enc = 0;
}
if (enc) {
rb_funcall(f, rb_intern("set_encoding"), 1, rb_enc_from_encoding(enc));
enc = rb_ascii8bit_encoding();
}
rb_funcall(f, rb_intern("set_encoding"), 1, rb_enc_from_encoding(enc));
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);