Fix redbean SQLite to report results on failure to open db (#760)

This commit is contained in:
Paul Kulchenko 2023-03-05 14:26:56 -08:00 committed by GitHub
parent da7c8c7b54
commit 22fcab131c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -639,7 +639,7 @@ static void closevms(lua_State *L, sdb *db, int temp) {
static int cleanupdb(lua_State *L, sdb *db) {
sdb_func *func;
sdb_func *func_next;
int top;
int top = lua_gettop(L);
int result;
if (!db->db) return SQLITE_MISUSE;
@ -679,6 +679,8 @@ static int cleanupdb(lua_State *L, sdb *db) {
func = func_next;
}
db->func = NULL;
lua_settop(L, top);
return result;
}