Respect exit status in expand(1)
This commit is contained in:
parent
cd35347203
commit
e6df377504
4
expand.c
4
expand.c
|
@ -20,6 +20,7 @@ main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
int tabstop = 8;
|
int tabstop = 8;
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
ARGBEGIN {
|
ARGBEGIN {
|
||||||
case 'i':
|
case 'i':
|
||||||
|
@ -38,13 +39,14 @@ main(int argc, char *argv[])
|
||||||
for (; argc > 0; argc--, argv++) {
|
for (; argc > 0; argc--, argv++) {
|
||||||
if (!(fp = fopen(argv[0], "r"))) {
|
if (!(fp = fopen(argv[0], "r"))) {
|
||||||
weprintf("fopen %s:", argv[0]);
|
weprintf("fopen %s:", argv[0]);
|
||||||
|
ret = 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
expand(argv[0], fp, tabstop);
|
expand(argv[0], fp, tabstop);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
Loading…
Reference in New Issue
Block a user