[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: luaL_loadfilex works fine only once per session under Windows.
- From: Roberto Ierusalimschy <roberto@...>
- Date: Tue, 21 Jan 2014 11:37:20 -0200
> The problem can be easily reproduced by a standalone lua.exe included in
> a distribution:
>
> [...]
> 2. I/O operations DO NOT clear the EOF indicator, despite they return a
> valid, read characters.
Isn't this just a bug in libc? IIUC, in ANSI C, once the eof indicator
is set, any read should return EOF...
7.19.3 Files
11. [...] The byte input functions read characters from the stream as if
by successive calls to the fgetc function.
7.19.7.1 The fgetc function
3. If the end-of-file indicator for the stream is set, or if the stream
is at end-of-file, the end-of-file indicator for the stream is set and
the fgetc function returns EOF.
-- Roberto