Module Name: src Committed By: christos Date: Mon Sep 15 23:29:16 UTC 2014
Modified Files: src/lib/libc/stdio: getdelim.3 Log Message: Fix documentation to reflect what happens when EOF is found before delimiter, aligning us with POSIX. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/lib/libc/stdio/getdelim.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libc/stdio/getdelim.3 diff -u src/lib/libc/stdio/getdelim.3:1.9 src/lib/libc/stdio/getdelim.3:1.10 --- src/lib/libc/stdio/getdelim.3:1.9 Wed Apr 20 19:37:51 2011 +++ src/lib/libc/stdio/getdelim.3 Mon Sep 15 19:29:16 2014 @@ -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