lua: init fixes

- call apk_atom_init()
- if no open flag is specified, then default to read-only.
cute-signatures
Natanael Copa 2011-02-19 04:25:05 +00:00
parent 08533d74fa
commit c79302d973
1 changed files with 3 additions and 0 deletions

View File

@ -148,8 +148,11 @@ static int Papk_db_open(lua_State *L)
memset(&opts, 0, sizeof(opts));
list_init(&opts.repository_list);
apk_atom_init();
if (lua_istable(L, 1))
get_dbopts(L, 1, &opts);
else
opts.open_flags |= APK_OPENF_READ;
db = lua_newuserdata(L, sizeof(struct apk_database));
luaL_getmetatable(L, APKDB_META);