You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-07-13 01:00:23 +02:00
Add ioReadLineParam() to allow return on eof.
ioReadLine() errors on eof because it has previously been used only for protocol reads. Returning on eof is handy for reading lines from files where eof is not considered an error.
This commit is contained in:
@ -431,6 +431,11 @@ testRun(void)
|
||||
ioReadOpen(read);
|
||||
TEST_ERROR(ioReadLine(read), FileReadError, "unable to find line in 10 byte buffer");
|
||||
|
||||
// Read line without eof
|
||||
read = ioBufferReadNew(BUFSTRDEF("1234"));
|
||||
ioReadOpen(read);
|
||||
TEST_RESULT_STR(strPtr(ioReadLineParam(read, true)), "1234", "read line without eof");
|
||||
|
||||
// Read IO into a buffer
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
ioBufferSizeSet(8);
|
||||
|
Reference in New Issue
Block a user