From 7a83cd003a064a067a510514b62686c3e972fede Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Tue, 28 Aug 2012 21:59:25 -0400 Subject: query_fileowner: don't append '/' if path is "/" Signed-off-by: Andrew Gregory Signed-off-by: Allan McRae --- src/pacman/query.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/pacman/query.c b/src/pacman/query.c index 0112423f..d1887e3a 100644 --- a/src/pacman/query.c +++ b/src/pacman/query.c @@ -123,8 +123,10 @@ static int query_fileowner(alpm_list_t *targets) } /* append trailing '/' removed by realpath */ - path[rootlen++] = '/'; - path[rootlen] = '\0'; + if(path[rootlen - 1] != '/') { + path[rootlen++] = '/'; + path[rootlen] = '\0'; + } db_local = alpm_get_localdb(config->handle); -- cgit v1.2.3-70-g09d2