[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: lua bug - loadfile gets stdin confused
- From: "David Burgess" <dburgess@...>
- Date: Thu, 19 Apr 2007 10:27:26 +1000
We may add freopen (actually, as an ANSI C facility, it deserves to be
in iolib), but we still must correct the problem of accessing a closed
stdin (even after a reopen).
I have attached a sample program for windows that shows how the
invalid stdxxx detection works.
However, what about in liolib.c of putting back the checks in f:close()
so that io.stdout is set to nil when we close it. It would seem to be
a simple solution that would generate consistent behaviour - no?
int main(int argc, char* argv)
h = _get_osfhandle(_fileno(stdout));
fprintf(stderr, "handle %08X\n",h);