lua-users home
lua-l archive

Re: lua bug - loadfile gets stdin confused

[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

AltStyle によって変換されたページ (->オリジナル) /