Fix documentation to reflect what happens when EOF is found before delimiter,

aligning us with POSIX.
This commit is contained in:
christos 2014-09-15 23:29:16 +00:00
parent 5c57068fcc
commit 57367022db
1 changed files with 8 additions and 5 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: getdelim.3,v 1.9 2011/04/20 23:37:51 enami Exp $
.\" $NetBSD: getdelim.3,v 1.10 2014/09/15 23:29:16 christos Exp $
.\"
.\" Copyright (c) 2009 The NetBSD Foundation, Inc.
.\" All rights reserved.
@ -27,7 +27,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd June 30, 2010
.Dd September 15, 2014
.Dt GETDELIM 3
.Os
.Sh NAME
@ -48,12 +48,14 @@ The
function reads from the
.Fa stream
until it encounters a character matching
.Fa delimiter ,
.Fa delimiter
or.
.DV EOF ,
storing the input in
.Fa *lineptr .
The buffer is
.Dv NUL Ns No -terminated
and includes the delimiter.
and includes the delimiter, if one was found.
The
.Fa delimiter
character must be representable as an unsigned char.
@ -88,7 +90,8 @@ The
.Fn getdelim
and
.Fn getline
functions return the number of characters read, including the delimiter.
functions return the number of characters read, including the delimiter if
one was found.
If no characters were read and the stream is at end-of-file, the functions
return \-1.
If an error occurs, the functions return \-1 and the global variable