diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-02-19 04:25:05 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-04-20 17:46:34 +0200 |
commit | a9d594683a12c2935a43898dfc7132ac536be362 (patch) | |
tree | ff621ab23c1bc57d5e03afac0a04704c666b6b1b /src | |
parent | 02c1f5b4b90fffbba2115cdf0bb1c17c520a2817 (diff) | |
download | apk-tools-a9d594683a12c2935a43898dfc7132ac536be362.tar.bz2 apk-tools-a9d594683a12c2935a43898dfc7132ac536be362.tar.xz |
lua: init fixes
- call apk_atom_init()
- if no open flag is specified, then default to read-only.
Diffstat (limited to 'src')
-rw-r--r-- | src/lua-apk.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lua-apk.c b/src/lua-apk.c index 7a04dc6..835d379 100644 --- a/src/lua-apk.c +++ b/src/lua-apk.c @@ -145,8 +145,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); |