From d2cec808dc143c26a67cd81ff1cd77e68bc0d12d Mon Sep 17 00:00:00 2001 From: Paul Kulchenko Date: Tue, 23 Aug 2022 20:54:51 -0700 Subject: [PATCH] Fix redbean to check for file read result when -F option is used (#569) --- tool/net/redbean.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tool/net/redbean.c b/tool/net/redbean.c index ea768d260..3c2f68f3c 100644 --- a/tool/net/redbean.c +++ b/tool/net/redbean.c @@ -1076,7 +1076,9 @@ static bool LuaEvalCode(const char *code) { } 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) {