From 13a3574979871a6f57321d988f621e212ff5e568 Mon Sep 17 00:00:00 2001 From: ceriel Date: Fri, 27 Feb 1987 09:54:23 +0000 Subject: [PATCH] used to dump core on empty files --- modules/src/read_em/read_em.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/src/read_em/read_em.c b/modules/src/read_em/read_em.c index e0ddce807..a028b6ef6 100644 --- a/modules/src/read_em/read_em.c +++ b/modules/src/read_em/read_em.c @@ -41,13 +41,18 @@ _fill() static int sz; if (_ich && _ich < &text[sz]) return _ich++, '\0'; + _ich = text; if (sys_read(fd, text, BUFSIZ, &sz) && sz > 0 ) { text[sz] = '\0'; - return _ich = text, (*_ich++&0377); + return (*_ich++&0377); + } + else { + sz = 0; + text[0] = 0; + return EOF; } - else return EOF; } #define NARGS 3 /* Maximum number of arguments */