diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-03-01 23:49:23 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-03-01 23:49:23 -0800 |
commit | f56e0a5f935bd525e2c19d8938d418e71bb269b8 (patch) | |
tree | 67d5e049f8808b827e209366d3aa8dc2753877d3 /parser.c | |
parent | 286dc9dabd46432fe60b55c9ae0c8d5d735fd466 (diff) | |
download | txr-f56e0a5f935bd525e2c19d8938d418e71bb269b8.tar.gz txr-f56e0a5f935bd525e2c19d8938d418e71bb269b8.tar.bz2 txr-f56e0a5f935bd525e2c19d8938d418e71bb269b8.zip |
listener: return value regression.
* parser.c (lino_getl, lino_gets): Return null pointer on EOF,
restoring original behavior that was broken by recent patches.
Diffstat (limited to 'parser.c')
-rw-r--r-- | parser.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1483,7 +1483,7 @@ static wchar_t *lino_getl(mem_t *stream_in, wchar_t *buf, size_t nchar) } *ptr++ = 0; - return buf; + return (ptr == buf + 1) ? 0 : buf; } static wchar_t *lino_gets(mem_t *stream_in, wchar_t *buf, size_t nchar) @@ -1502,7 +1502,7 @@ static wchar_t *lino_gets(mem_t *stream_in, wchar_t *buf, size_t nchar) } *ptr++ = 0; - return buf; + return (ptr == buf + 1) ? 0 : buf; } |