From c4d6688694975c877e6bff3d6147ae23207a0cbe Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 30 Sep 2011 11:08:49 -0500 Subject: Use _alpm_local_db_pkgpath in _cache_changelog_open Another place where we were doing the dirty work by hand. Signed-off-by: Dan McGee --- lib/libalpm/be_local.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index 88ecec0c..56cf38bb 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -173,11 +173,11 @@ static alpm_list_t *_cache_get_backup(alpm_pkg_t *pkg) */ static void *_cache_changelog_open(alpm_pkg_t *pkg) { - char clfile[PATH_MAX]; alpm_db_t *db = alpm_pkg_get_db(pkg); - snprintf(clfile, PATH_MAX, "%s/%s/%s-%s/changelog", - pkg->handle->dbpath, db->treename, pkg->name, pkg->version); - return fopen(clfile, "r"); + char *clfile = _alpm_local_db_pkgpath(db, pkg, "changelog"); + FILE *f = fopen(clfile, "r"); + free(clfile); + return f; } /** -- cgit v1.2.3