mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* io.c: Note that methods other than IO#gets may increase IO#lineno.
[Ruby 1.9 - Bug #4902] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
dd2dfc71e7
commit
0c3833ec5a
2 changed files with 13 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
|||
Sat Jul 9 09:14:56 2011 Eric Hodel <drbrain@segment7.net>
|
||||
|
||||
* io.c: Note that methods other than IO#gets may increase IO#lineno.
|
||||
[Ruby 1.9 - Bug #4902]
|
||||
|
||||
Sat Jul 9 08:39:39 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* common.mk (RUN_OPT): disable gems.
|
||||
|
|
13
io.c
13
io.c
|
@ -2633,12 +2633,15 @@ rb_io_gets_m(int argc, VALUE *argv, VALUE io)
|
|||
* call-seq:
|
||||
* ios.lineno -> integer
|
||||
*
|
||||
* Returns the current line number in <em>ios</em>. The stream must be
|
||||
* Returns the current line number in <em>ios</em>. The stream must be
|
||||
* opened for reading. <code>lineno</code> counts the number of times
|
||||
* <code>gets</code> is called, rather than the number of newlines
|
||||
* encountered. The two values will differ if <code>gets</code> is
|
||||
* called with a separator other than newline. See also the
|
||||
* <code>$.</code> variable.
|
||||
* #gets is called rather than the number of newlines encountered. The two
|
||||
* values will differ if #gets is called with a separator other than newline.
|
||||
*
|
||||
* Methods that use <code>$/</code> like #each, #lines and #readline will
|
||||
* also increment <code>lineno</code>.
|
||||
*
|
||||
* See also the <code>$.</code> variable.
|
||||
*
|
||||
* f = File.new("testfile")
|
||||
* f.lineno #=> 0
|
||||
|
|
Loading…
Reference in a new issue