This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[patch] make getline return description match the code


If getline() reads a line with no newline, and reaches EOF, it still
returns the number of bytes read, and not -1 as the documentation
implies. This patch just clarifies that.

2001-01-05  Ben Collins  <bcollins@debian.org>

	* manual/stdio.texi: getline(): clarify the return value in the
	  case of EOF being reached before a newline.

-- 
 -----------=======-=-======-=========-----------=====------------=-=------
/  Ben Collins  --  ...on that fantastic voyage...  --  Debian GNU/Linux   \
`  bcollins@debian.org  --  bcollins@openldap.org  --  bcollins@linux.com  '
 `---=========------=======-------------=-=-----=-===-======-------=--=---'
Index: stdio.texi
===================================================================
RCS file: /cvs/glibc/libc/manual/stdio.texi,v
retrieving revision 1.111
diff -u -u -r1.111 stdio.texi
--- stdio.texi	2000/12/25 00:44:08	1.111
+++ stdio.texi	2001/01/05 15:30:37
@@ -592,8 +592,8 @@
 This function is a GNU extension, but it is the recommended way to read
 lines from a stream.  The alternative standard functions are unreliable.
 
-If an error occurs or end of file is reached, @code{getline} returns
-@code{-1}.
+If an error occurs or end of file is reached without any bytes read,
+@code{getline} returns @code{-1}.
 @end deftypefun
 
 @comment stdio.h

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]