Use freopen() instead of a nasty hack.

This commit is contained in:
Tim J. Robbins 2004-07-15 06:57:36 +00:00
parent d1573e5841
commit c7fcd3025b

View File

@ -103,8 +103,7 @@ main(int argc, char *argv[])
do {
if (argc > 0) {
close(0);
if (!(f = fopen(argv[0], "r"))) {
if (!(f = freopen(argv[0], "r", stdin))) {
fflush(stdout);
err(1, "%s", argv[0]);
}