summaryrefslogtreecommitdiff
path: root/lib/libalpm/db.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm/db.c')
-rw-r--r--lib/libalpm/db.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c
index ad5f0bc1..8a235e21 100644
--- a/lib/libalpm/db.c
+++ b/lib/libalpm/db.c
@@ -326,7 +326,11 @@ alpm_db_t *_alpm_db_new(const char *treename, int is_local)
CALLOC(db, 1, sizeof(alpm_db_t), return NULL);
STRDUP(db->treename, treename, return NULL);
- db->is_local = is_local;
+ if(is_local) {
+ db->status |= DB_STATUS_LOCAL;
+ } else {
+ db->status &= ~DB_STATUS_LOCAL;
+ }
return db;
}
@@ -359,7 +363,7 @@ const char *_alpm_db_path(alpm_db_t *db)
RET_ERR(db->handle, ALPM_ERR_DB_OPEN, NULL);
}
- if(db->is_local) {
+ if(db->status & DB_STATUS_LOCAL) {
pathsize = strlen(dbpath) + strlen(db->treename) + 2;
CALLOC(db->_path, 1, pathsize, RET_ERR(db->handle, ALPM_ERR_MEMORY, NULL));
sprintf(db->_path, "%s%s/", dbpath, db->treename);