Fix expand when one of multiple files can't be opened
Currently when multiple files are specified and one of them can't be opened, expand doesn't correctly skip over the missing file. This patch fixes that.
This commit is contained in:
parent
8b87d0098a
commit
6561567597
3
expand.c
3
expand.c
@ -39,7 +39,7 @@ main(int argc, char *argv[])
|
|||||||
dsc.fp = stdin;
|
dsc.fp = stdin;
|
||||||
expand(&dsc, tabstop);
|
expand(&dsc, tabstop);
|
||||||
} else {
|
} else {
|
||||||
for (; argc > 0; argc--) {
|
for (; argc > 0; argc--, argv++) {
|
||||||
if (!(fp = fopen(*argv, "r"))) {
|
if (!(fp = fopen(*argv, "r"))) {
|
||||||
weprintf("fopen %s:", *argv);
|
weprintf("fopen %s:", *argv);
|
||||||
continue;
|
continue;
|
||||||
@ -48,7 +48,6 @@ main(int argc, char *argv[])
|
|||||||
dsc.fp = fp;
|
dsc.fp = fp;
|
||||||
expand(&dsc, tabstop);
|
expand(&dsc, tabstop);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
argv++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
|
Loading…
Reference in New Issue
Block a user