Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   ArchLinux Pacman Development (http://www.linux-archive.org/archlinux-pacman-development/)
-   -   query_fileowner: don't append '/' if path is "/" (http://www.linux-archive.org/archlinux-pacman-development/693054-query_fileowner-dont-append-if-path.html)

Andrew Gregory 08-11-2012 09:35 PM

query_fileowner: don't append '/' if path is "/"
 
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
---
src/pacman/query.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/pacman/query.c b/src/pacman/query.c
index 9afe680..d882e5a 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] = '';
+ if(strcmp(path, "/") != 0) {
+ path[rootlen++] = '/';
+ path[rootlen] = '';
+ }

db_local = alpm_get_localdb(config->handle);

--
1.7.11.4


All times are GMT. The time now is 10:48 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.