summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2012-07-07 15:12:49 -0400
committerDan McGee <dan@archlinux.org>2012-09-18 08:19:11 -0500
commitbad00696f34bd37243d0db411c26319ef0f640d8 (patch)
treed7d9ad32e5fd1fb0f3c72538ef1a57da2819ebeb /src
parent0fe562011c83229472a75dc43d34f780843e16de (diff)
downloadpacman-bad00696f34bd37243d0db411c26319ef0f640d8.tar.xz
query_fileowner: break/continue pkgfile loop
Break out of pkgfile loop on match or continue if the pkgfile path is too long. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/pacman/query.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pacman/query.c b/src/pacman/query.c
index 9b1ea6f1..a14b3e36 100644
--- a/src/pacman/query.c
+++ b/src/pacman/query.c
@@ -212,12 +212,14 @@ static int query_fileowner(alpm_list_t *targets)
if(strcmp(pkgfile, bname) == 0) {
print_query_fileowner(filename, info);
found = 1;
+ break;
}
continue;
}
if(rootlen + 1 + strlen(pkgfile) > PATH_MAX) {
pm_printf(ALPM_LOG_ERROR, _("path too long: %s%s\n"), root, pkgfile);
+ continue;
}
/* concatenate our file and the root path */
strcpy(path + rootlen, pkgfile);
@@ -229,6 +231,8 @@ static int query_fileowner(alpm_list_t *targets)
if(ppath && strcmp(ppath, rpath) == 0) {
print_query_fileowner(filename, info);
found = 1;
+ free(ppath);
+ break;
}
free(ppath);
}