opnsense-src/lib/libc/tests/stdio
Bryan Drewery 8f8a794775 getdelim(3): Fix losing data on [EAGAIN]
Currently when an [EAGAIN] is encountered we return a partial result
that does not contain the delimeter.  On the next (successful) read we
were returning the next part of the line without the preceding string
from the first failed call.

Fix this by using the same mechanism as ungetc(3) does.  For the buffered
case we could simply set fp->_r and fp->_p back to their values before
sappend() is ran but for simplicity ungetc(3) is done in there as well.

Reviewed by:	kib
Differential Revision: https://reviews.freebsd.org/D31687
2021-09-02 11:26:26 -07:00
..
fdopen_test.c Integrate tools/regression/lib/libc/stdio into the FreeBSD test suite 2015-11-08 06:37:50 +00:00
fmemopen2_test.c Make sure fmemopen succeeds in :test_append_binary_pos before calling ftell 2016-04-19 23:59:10 +00:00
fopen_test.c Integrate tools/regression/lib/libc/stdio into the FreeBSD test suite 2015-11-08 06:37:50 +00:00
freopen_test.c Fix double fclose of fp1 when freopen fails 2016-04-20 00:19:04 +00:00
getdelim_test.c getdelim(3): Fix losing data on [EAGAIN] 2021-09-02 11:26:26 -07:00
gets_s_test.c Conform to Berne Convention. 2018-05-22 06:22:58 +00:00
Makefile Add new gets_s(3) stdio function. 2018-04-03 18:52:38 +00:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
mkostemp_test.c Integrate tools/regression/lib/libc/stdio into the FreeBSD test suite 2015-11-08 06:37:50 +00:00
open_memstream2_test.c Similar to r305920, remove spurious newlines from ATF_REQUIRE_MSG calls 2016-09-18 06:00:07 +00:00
open_wmemstream_test.c Similar to r305920, remove spurious newlines from ATF_REQUIRE_MSG calls 2016-09-18 06:00:07 +00:00
perror_test.c Remove unused variables to fix building world 2015-11-15 12:48:42 +00:00
print_positional_test.c print_positional_test: Fix misuse of wchar APIs 2016-05-12 04:08:45 +00:00
printbasic_test.c Expect :int_within_limits to fail when ptrdiff_t/*intmax_t differ in base type 2017-02-07 05:39:00 +00:00
printfloat_test.c AArch64: Don't set flush-subnormals-to-zero flag on startup 2021-03-01 14:27:30 +00:00
scanfloat_test.c Remove unused variables to fix building world 2015-11-15 12:48:42 +00:00