From: Ian Darwin Date: Thu, 12 Nov 1987 12:57:50 +0000 (+0000) Subject: Handle case where read of HOWMANY from file returns zero! X-Git-Tag: FILE3_27~348 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=281710df29a1b9a8605f5d9216288b3151d20592;p=file Handle case where read of HOWMANY from file returns zero! --- diff --git a/src/file.c b/src/file.c index 794ed9fd..e0cc6f45 100644 --- a/src/file.c +++ b/src/file.c @@ -34,7 +34,7 @@ #ifndef lint static char *moduleid = - "@(#)$Header: /home/glen/git/file/cvs/file/src/file.c,v 1.12 1987/11/06 21:03:16 ian Exp $"; + "@(#)$Header: /home/glen/git/file/cvs/file/src/file.c,v 1.13 1987/11/12 12:57:50 ian Exp $"; #endif /* lint */ extern char *ckfmsg; int debug = 0, /* huh? */ @@ -167,6 +167,9 @@ readit: */ if ((nbytes = read(fd, buf, HOWMANY)) == -1) warning("read failed"); + if (nbytes == 0) { + ckfputs("empty", stdout); + } else /* * try tests in /etc/magic (or surrogate magic file) */