Use freopen() instead of a nasty hack.
This commit is contained in:
parent
d1573e5841
commit
c7fcd3025b
@ -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]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user