summaryrefslogtreecommitdiffstats
path: root/src/pacman/query.c
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2012-08-29 03:59:25 +0200
committerAllan McRae <allan@archlinux.org>2013-01-04 12:49:38 +0100
commit7a83cd003a064a067a510514b62686c3e972fede (patch)
tree14f2a2608e31c83668dafb08e6903e889dab7f1f /src/pacman/query.c
parent49c5f515e91b2978f951634d6118ff58aa64b1de (diff)
downloadpacman-7a83cd003a064a067a510514b62686c3e972fede.tar.gz
pacman-7a83cd003a064a067a510514b62686c3e972fede.tar.xz
query_fileowner: don't append '/' if path is "/"
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'src/pacman/query.c')
-rw-r--r--src/pacman/query.c6
1 files changed, 4 insertions, 2 deletions
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);