summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2017-05-09 07:43:22 +0200
committerAllan McRae <allan@archlinux.org>2017-05-09 07:43:22 +0200
commit45459eebae0b0427dce582985c7c5895da78b7c2 (patch)
treed72cc06d8a876da434d23131fa47a786750569e9
parentadc95f436b55dde320e9be9e38e7f4b48df4cdc5 (diff)
downloadpacman-45459eebae0b0427dce582985c7c5895da78b7c2.tar.gz
pacman-45459eebae0b0427dce582985c7c5895da78b7c2.tar.xz
Handle empty string passed to query_owner
Passing an empty string to pacman -Qo results in: error: No package owns <first directory in $PATH> Treat an empty string being passed the same as recieving a NULL value and exit searching for an owner. Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r--src/pacman/query.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pacman/query.c b/src/pacman/query.c
index a8417570..119764bc 100644
--- a/src/pacman/query.c
+++ b/src/pacman/query.c
@@ -161,7 +161,8 @@ static int query_fileowner(alpm_list_t *targets)
size_t len, is_dir;
unsigned int found = 0;
- if((filename = strdup(t->data)) == NULL) {
+ filename = strdup(t->data);
+ if(filename == NULL || strcmp(filename, "") == 0) {
goto targcleanup;
}