summaryrefslogtreecommitdiff
path: root/usr.bin/expand
diff options
context:
space:
mode:
authorTim J. Robbins <tjr@FreeBSD.org>2002-05-24 06:00:47 +0000
committerTim J. Robbins <tjr@FreeBSD.org>2002-05-24 06:00:47 +0000
commit5069e2716c082d52d4f861969686eb54685fc7e1 (patch)
tree0571a8f5b8e9120e2f99912d819a0854864d1d30 /usr.bin/expand
parent7d05a3831403d0ae3e5392a93c254320a5da4fc9 (diff)
downloadsrc-test2-5069e2716c082d52d4f861969686eb54685fc7e1.tar.gz
src-test2-5069e2716c082d52d4f861969686eb54685fc7e1.zip
Notes
Diffstat (limited to 'usr.bin/expand')
-rw-r--r--usr.bin/expand/expand.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.bin/expand/expand.c b/usr.bin/expand/expand.c
index ec2a20dafe95..f83419df6bbd 100644
--- a/usr.bin/expand/expand.c
+++ b/usr.bin/expand/expand.c
@@ -67,6 +67,7 @@ main(argc, argv)
{
register int c, column;
register int n;
+ int rval;
/* handle obsolete syntax */
while (argc > 1 && argv[1][0] == '-' && isdigit(argv[1][1])) {
@@ -88,10 +89,15 @@ main(argc, argv)
argc -= optind;
argv += optind;
+ rval = 0;
do {
if (argc > 0) {
- if (freopen(argv[0], "r", stdin) == NULL)
- errx(1, "%s", argv[0]);
+ if (freopen(argv[0], "r", stdin) == NULL) {
+ warn("%s", argv[0]);
+ rval = 1;
+ argc--, argv++;
+ continue;
+ }
argc--, argv++;
}
column = 0;
@@ -144,7 +150,7 @@ main(argc, argv)
}
}
} while (argc > 0);
- exit(0);
+ exit(rval);
}
static void