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:
parent
11b85f7aac
commit
eac021d96a
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user