mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-04 18:28:30 +00:00
Fix redbean SQLite to report results on failure to open db (#760)
This commit is contained in:
parent
da7c8c7b54
commit
22fcab131c
1 changed files with 3 additions and 1 deletions
|
@ -639,7 +639,7 @@ static void closevms(lua_State *L, sdb *db, int temp) {
|
||||||
static int cleanupdb(lua_State *L, sdb *db) {
|
static int cleanupdb(lua_State *L, sdb *db) {
|
||||||
sdb_func *func;
|
sdb_func *func;
|
||||||
sdb_func *func_next;
|
sdb_func *func_next;
|
||||||
int top;
|
int top = lua_gettop(L);
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
if (!db->db) return SQLITE_MISUSE;
|
if (!db->db) return SQLITE_MISUSE;
|
||||||
|
@ -679,6 +679,8 @@ static int cleanupdb(lua_State *L, sdb *db) {
|
||||||
func = func_next;
|
func = func_next;
|
||||||
}
|
}
|
||||||
db->func = NULL;
|
db->func = NULL;
|
||||||
|
|
||||||
|
lua_settop(L, top);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue