summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-02-19 04:25:05 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2011-02-19 04:25:05 +0000
commitfde9ad1782dd4ddb28c428b488e0278471a91c90 (patch)
tree3372408f22095670682998d28f2cb2ca4d109d2f /src
parent24779c4df4b9efaa2945a99497da357dea70d75e (diff)
downloadapk-tools-fde9ad1782dd4ddb28c428b488e0278471a91c90.tar.bz2
apk-tools-fde9ad1782dd4ddb28c428b488e0278471a91c90.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.c3
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);