From acee3572e83f4b008db0f7b3ab705b3306525101 Mon Sep 17 00:00:00 2001 From: David A Roberts Date: Sun, 26 May 2024 12:39:57 +1000 Subject: [PATCH] Patch wak to line-buffer inputs --- wak.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wak.c b/wak.c index fd07ab86..9c9c1132 100755 --- a/wak.c +++ b/wak.c @@ -3583,7 +3583,11 @@ static ssize_t getrec_f(struct zfile *zfp) #define RS_LENGTH_MARGIN (INIT_RECBUF_LEN / 8) if (!zfp->recbuf) zfp->recbuf = xmalloc((zfp->recbufsize = INIT_RECBUF_LEN) + 1); - zfp->endoffs = fread(zfp->recbuf, 1, zfp->recbufsize, zfp->fp); + if (fgets(zfp->recbuf, zfp->recbufsize, zfp->fp)) { + zfp->endoffs = strlen(zfp->recbuf); + } else { + zfp->endoffs = 0; + } zfp->recoffs = 0; zfp->recbuf[zfp->endoffs] = 0; if (!zfp->endoffs) break;