[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: lua bug - loadfile gets stdin confused
- From: roberto@... (Roberto Ierusalimschy)
- Date: Wed, 18 Apr 2007 15:19:24 -0300
> Reading between the lines, the standard is pretty clear that
> continuing to operate on a FILE after calling fclose() is not
> valid. Effectively, continued use of a FILE* after calling
> fclose() is similar to continued use a malloc()ed pointer after
> calling free(). You might get lucky, but that doesn't make it valid.
That is true. Perhaps the best solution to all these problems would be
to prohibit Lua from closing a standard file (stdin/stdout/stderr).
Older versions of Lua had this restriction, I cannot remember why
we lifted it.