Fix redbean to check for file read result when -F option is used (#569)

This commit is contained in:
Paul Kulchenko 2022-08-23 20:54:51 -07:00 committed by GitHub
parent 91a3252434
commit d2cec808dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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) {