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_internal): decrement for ungotten line.

[ruby-dev:42680]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-12-05 02:27:13 +00:00
parent c19cba4414
commit af54c1694c
3 changed files with 12 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Sun Dec 5 11:27:08 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ruby.c (load_file_internal): decrement for ungotten line.
[ruby-dev:42680]
Sun Dec 5 10:32:11 2010 Tanaka Akira <akr@fsij.org> Sun Dec 5 10:32:11 2010 Tanaka Akira <akr@fsij.org>
* complex.c: parenthesize macro arguments. * complex.c: parenthesize macro arguments.

1
ruby.c
View file

@ -1551,6 +1551,7 @@ load_file_internal(VALUE arg)
rb_funcall(f, set_encoding, 1, rb_enc_from_encoding(enc)); rb_funcall(f, set_encoding, 1, rb_enc_from_encoding(enc));
if (xflag || opt->xflag) { if (xflag || opt->xflag) {
line_start--;
search_shebang: search_shebang:
forbid_setid("-x"); forbid_setid("-x");
opt->xflag = FALSE; opt->xflag = FALSE;

View file

@ -271,6 +271,12 @@ class TestRubyOptions < Test::Unit::TestCase
assert_equal("\"\u3042\"", r.join.force_encoding(Encoding::UTF_8)) assert_equal("\"\u3042\"", r.join.force_encoding(Encoding::UTF_8))
assert_equal([], e) assert_equal([], e)
end end
bug4118 = '[ruby-dev:42680]'
assert_in_out_err(%w[], "#!/bin/sh\n""#!shebang\n""#!ruby\n""puts __LINE__\n",
%w[4], [], bug4118)
assert_in_out_err(%w[-x], "#!/bin/sh\n""#!shebang\n""#!ruby\n""puts __LINE__\n",
%w[4], [], bug4118)
end end
def test_sflag def test_sflag