]> git.draconx.ca Git - dxcommon.git/commit
dx_getline: Fix EOF handling in standard C fallback. master
authorNick Bowler <nbowler@draconx.ca>
Sat, 18 May 2024 20:14:36 +0000 (16:14 -0400)
committerNick Bowler <nbowler@draconx.ca>
Sat, 18 May 2024 20:14:36 +0000 (16:14 -0400)
commit1096a8ac154a1e58b527a839f062963b5db59344
treef7af7ba22ecf940a78da6af3db0d67e6066732ec
parent27f6a9c3d4663286f1bec753fbd035ab1a6eb5de
dx_getline: Fix EOF handling in standard C fallback.

The return value of the function at end of input was not tested so of
course it does not work: in the standard C fallback, a mistake was
introduced during the import and it returns DX_GETLINE_ERROR instead
of the expected DX_GETLINE_EOF.

Easy enough to fix and update the test program to check this.
src/getline.h
t/getline.c