Handle empty string passed to query_owner
Passing an empty string to pacman -Qo results in: error: No package owns <first directory in $PATH> Catch empty strings and report an error. Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
3a9a510ca8
commit
24ab8717d4
1 changed files with 5 additions and 0 deletions
|
@ -165,6 +165,11 @@ static int query_fileowner(alpm_list_t *targets)
|
|||
goto targcleanup;
|
||||
}
|
||||
|
||||
if(strcmp(filename, "") == 0) {
|
||||
pm_printf(ALPM_LOG_ERROR, _("empty string passed to file owner query\n"));
|
||||
goto targcleanup;
|
||||
}
|
||||
|
||||
/* trailing '/' causes lstat to dereference directory symlinks */
|
||||
len = strlen(filename) - 1;
|
||||
while(len > 0 && filename[len] == '/') {
|
||||
|
|
Loading…
Add table
Reference in a new issue