summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-09 00:21:44 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-09 00:21:44 +0000
commit0c3833ec5ab485175edefe78b307af0f2acdd973 (patch)
tree67882aaf5f1c00066434dd324b080f19ca5fa367 /io.c
parentdd2dfc71e7c887b054c0eef930ff1a708fc2de52 (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
Diffstat (limited to 'io.c')
-rw-r--r--io.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/io.c b/io.c
index 90cc2b3a30..2a161ed424 100644
--- a/io.c
+++ b/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