Consolidate handling of some fopen failures.

This commit is contained in:
Matt Kraai 2000-09-27 02:43:35 +00:00
parent e0bcce09ba
commit bbaef66b3f
14 changed files with 32 additions and 73 deletions

View file

@ -1447,10 +1447,7 @@ int shell_main(int argc_l, char **argv_l)
fprintf(stdout, "Enter 'help' for a list of built-in commands.\n\n");
} else if (local_pending_command==NULL) {
//fprintf(stdout, "optind=%d argv[optind]='%s'\n", optind, argv[optind]);
input = fopen(argv[optind], "r");
if (!input) {
fatalError("%s: %s\n", argv[optind], strerror(errno));
}
input = xfopen(argv[optind], "r");
}
/* initialize the cwd -- this is never freed...*/