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>
This commit is contained in:
Alexey Zelkin 1999-12-28 12:55:58 +00:00
parent 317b1ddf87
commit c7986155e0

View File

@ -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;