[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua bug - loadfile gets stdin confused
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Thu, 19 Apr 2007 00:06:16 -0300
> The fix to luaL_loadfile is simple (I posted a patch yesterday).
Here is a simpler patch (by Roberto) that does not use a flag:
< if (c == LUA_SIGNATURE[0] && lf.f != stdin) { /* binary file? */
---
> if (c == LUA_SIGNATURE[0] && filename) { /* binary file? */
< if (lf.f != stdin) fclose(lf.f); /* close file (even in case of errors) */
---
> if (filename) fclose(lf.f); /* close file (even in case of errors) */
--lhf