diff options
Diffstat (limited to 'usr.bin/fold')
-rw-r--r-- | usr.bin/fold/fold.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/fold/fold.c b/usr.bin/fold/fold.c index 894e821..39f8bfa 100644 --- a/usr.bin/fold/fold.c +++ b/usr.bin/fold/fold.c @@ -73,7 +73,7 @@ main(argc, argv) char **argv; { register int ch; - int width; + int rval, width; char *p; (void) setlocale(LC_CTYPE, ""); @@ -110,14 +110,16 @@ main(argc, argv) if (width == -1) width = DEFLINEWIDTH; + rval = 0; if (!*argv) fold(width); else for (; *argv; ++argv) if (!freopen(*argv, "r", stdin)) { - err(1, "%s", *argv); + warn("%s", *argv); + rval = 1; } else fold(width); - exit(0); + exit(rval); } static void |