diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-09 00:21:44 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-09 00:21:44 +0000 |
commit | 0c3833ec5ab485175edefe78b307af0f2acdd973 (patch) | |
tree | 67882aaf5f1c00066434dd324b080f19ca5fa367 | |
parent | dd2dfc71e7c887b054c0eef930ff1a708fc2de52 (diff) |
* 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
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | io.c | 13 |
2 files changed, 13 insertions, 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. @@ -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 |