Consolidate handling of some fopen failures.
diff --git a/sh.c b/sh.c
index 77efc6a..b106142 100644
--- a/sh.c
+++ b/sh.c
@@ -1447,10 +1447,7 @@
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...*/