diff options
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; |