lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> 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