If a file cannot be processed, try to process any remaining files

then exit non-zero.
This commit is contained in:
Tim J. Robbins 2002-05-25 03:04:28 +00:00
parent 4d574756ac
commit fb2582c006

View File

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