diff options
author | phantom <phantom@FreeBSD.org> | 1999-12-28 12:55:58 +0000 |
---|---|---|
committer | phantom <phantom@FreeBSD.org> | 1999-12-28 12:55:58 +0000 |
commit | fdfdda53b96f5c44d173d7f6d4bf59fe67c7ef30 (patch) | |
tree | 80ebf552343d801aa6ec31aa017260e490a6c476 /gnu | |
parent | 8d188898fdfd752a215b2d8cc2e49aacd443e0b7 (diff) | |
download | FreeBSD-src-fdfdda53b96f5c44d173d7f6d4bf59fe67c7ef30.zip FreeBSD-src-fdfdda53b96f5c44d173d7f6d4bf59fe67c7ef30.tar.gz |
Better handling groff failures. If popen(ROFF_COMMAND) returns zero bytes
then handle it as problem. This commit fixes problem with archiving empty files.
PR: gnu/5767
Submitted by: Bill Fenner <fenner@parc.xerox.com>
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/man/man/man.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gnu/usr.bin/man/man/man.c b/gnu/usr.bin/man/man/man.c index 8120134..cd62990 100644 --- a/gnu/usr.bin/man/man/man.c +++ b/gnu/usr.bin/man/man/man.c @@ -1254,10 +1254,12 @@ make_cat_file (path, man_file, cat_file, manid) } #endif - while ((s = getc(pp)) != EOF) - putc(s, fp); + f = 0; + while ((s = getc(pp)) != EOF) { + putc(s, fp); f++; + } - if ((s = pclose(pp)) == -1) { + if (!f || ((s = pclose(pp)) == -1)) { s = errno; fprintf(stderr, "Failed.\n"); errno = s; |