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:
parent
0fe562011c
commit
bad00696f3
1 changed files with 4 additions and 0 deletions
|
@ -212,12 +212,14 @@ static int query_fileowner(alpm_list_t *targets)
|
||||||
if(strcmp(pkgfile, bname) == 0) {
|
if(strcmp(pkgfile, bname) == 0) {
|
||||||
print_query_fileowner(filename, info);
|
print_query_fileowner(filename, info);
|
||||||
found = 1;
|
found = 1;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(rootlen + 1 + strlen(pkgfile) > PATH_MAX) {
|
if(rootlen + 1 + strlen(pkgfile) > PATH_MAX) {
|
||||||
pm_printf(ALPM_LOG_ERROR, _("path too long: %s%s\n"), root, pkgfile);
|
pm_printf(ALPM_LOG_ERROR, _("path too long: %s%s\n"), root, pkgfile);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
/* concatenate our file and the root path */
|
/* concatenate our file and the root path */
|
||||||
strcpy(path + rootlen, pkgfile);
|
strcpy(path + rootlen, pkgfile);
|
||||||
|
@ -229,6 +231,8 @@ static int query_fileowner(alpm_list_t *targets)
|
||||||
if(ppath && strcmp(ppath, rpath) == 0) {
|
if(ppath && strcmp(ppath, rpath) == 0) {
|
||||||
print_query_fileowner(filename, info);
|
print_query_fileowner(filename, info);
|
||||||
found = 1;
|
found = 1;
|
||||||
|
free(ppath);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
free(ppath);
|
free(ppath);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue