From 782f3bd3f9d89130e7b8486e82e2f7f270833013 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 27 Oct 2008 06:55:06 +0000 Subject: [PATCH] * io.c (argf_init): initial value of $. should be 0. see [ruby-dev:36937]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ io.c | 2 +- test/ruby/test_io.rb | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 157fa41873de0b..5282b620afe11b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Oct 27 15:55:04 2008 Nobuyoshi Nakada + + * io.c (argf_init): initial value of $. should be 0. + see [ruby-dev:36937]. + Mon Oct 27 15:38:38 2008 Yuki Sonoda (Yugui) * test/minitest/test_mini_test.rb diff --git a/io.c b/io.c index ff1c74a3e31ec2..6e76f23c8b5e51 100644 --- a/io.c +++ b/io.c @@ -5821,7 +5821,7 @@ argf_init(struct argf *p, VALUE v) { p->filename = Qnil; p->current_file = Qnil; - p->lineno = Qnil; + p->lineno = INT2FIX(0); p->argv = v; } diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 4d9bb51fe3a7b2..4305293a3d9a61 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -812,7 +812,7 @@ def test_set_lineno f.gets; p $. end SRC - assert_equal("nil,1,2,2,1001,1001,1001,1,2,3,3", f.read.chomp.gsub("\n", ",")) + assert_equal("0,1,2,2,1001,1001,1001,1,2,3,3", f.read.chomp.gsub("\n", ",")) end pipe(proc do |w|