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>
This commit is contained in:
Andrew Gregory 2012-07-07 15:12:49 -04:00 committed by Dan McGee
parent 0fe562011c
commit bad00696f3
1 changed files with 4 additions and 0 deletions

View File

@ -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);
}