Fix redbean to check for file read result when -F option is used

This commit is contained in:
Paul Kulchenko 2022-08-23 19:31:02 -07:00
parent 91a3252434
commit 8c5b5099b0

View file

@ -1076,7 +1076,9 @@ static bool LuaEvalCode(const char *code) {
} }
static bool LuaEvalFile(const char *path) { static bool LuaEvalFile(const char *path) {
return LuaEvalCode(gc(xslurp(path, 0))); char *f = gc(xslurp(path, 0));
if (!f) FATALF("(cfg) error: failed to read file %`'s", path);
return LuaEvalCode(f);
} }
static bool LuaOnClientConnection(void) { static bool LuaOnClientConnection(void) {