Re: lua bug - loadfile gets stdin confused
[
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: 2007年4月19日 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