summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ruby.c10
-rw-r--r--test/ruby/test_rubyoptions.rb2
2 files changed, 11 insertions, 1 deletions
@@ -1668,6 +1668,14 @@ process_options(int argc, char **argv, struct cmdline_options *opt)
return (VALUE)iseq;
}
struct load_file_arg {
VALUE parser;
VALUE fname;
@@ -1715,6 +1723,7 @@ load_file_internal(VALUE argp_v)
line_start++;
RSTRING_GETMEM(line, str, len);
if (len > 2 && str[0] == '#' && str[1] == '!') {
if ((p = strstr(str+2, ruby_engine)) != 0) {
goto start_read;
}
@@ -1732,6 +1741,7 @@ load_file_internal(VALUE argp_v)
return 0;
RSTRING_GETMEM(line, str, len);
if ((p = strstr(str, ruby_engine)) == 0) {
/* not ruby script, assume -x flag */
goto search_shebang;
@@ -313,7 +313,7 @@ class TestRubyOptions < Test::Unit::TestCase
[], /: no Ruby script found in input/)
assert_in_out_err([{'RUBYOPT' => nil}], "#!ruby -KU -Eutf-8\r\np \"\u3042\"\r\n",
- ["\"\u3042\""], [],
encoding: Encoding::UTF_8)
bug4118 = '[ruby-dev:42680]'