diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2025-01-24 21:14:59 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2025-01-24 21:14:59 -0800 |
commit | 17cfe8242b4c920f713edf460d44939da69e05cd (patch) | |
tree | 02222bb0947b5bc5b615fc0c7088d82239663176 /linenoise/example.c | |
parent | 31540ce793f1aa551e1df3054f37fb3221618361 (diff) | |
download | txr-17cfe8242b4c920f713edf460d44939da69e05cd.tar.gz txr-17cfe8242b4c920f713edf460d44939da69e05cd.tar.bz2 txr-17cfe8242b4c920f713edf460d44939da69e05cd.zip |
get-csv: bugfix: return nil on EOF.
* stream.c (get_csv): Let's add a new state init. If get_char
returns nil and we are in the init state, let's bail to a
nil return. While we are at it, let's not allocate the record
or string until we read at least one character. If we read
a character in the init state, let's allocate those two
objects, and then change to the rfield state and fall through
to it to handle the character.
* tests/010/csv.tl: Fix one incorrect test: (tocsv "") now
returns nil, as it should. Add tests for multiple record
extraction, also covering missing line termination on the last
record as well as CR-LF termination.
* txr.1: Documented nil return conditions.
Diffstat (limited to 'linenoise/example.c')
0 files changed, 0 insertions, 0 deletions