summaryrefslogtreecommitdiff
path: root/src/selection.c
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2013-02-12 20:02:04 +0100
committerMichael Schroeder <mls@suse.de>2013-02-12 20:02:04 +0100
commit9479459e0d255af627f0310b2407b04d653fff3f (patch)
tree13e14866a0fceeceda4fba258d5e40236e06c347 /src/selection.c
parent2e2cbbfecc239593f3b9c6734c4a1dd69bdb657f (diff)
downloadlibsolv-9479459e0d255af627f0310b2407b04d653fff3f.tar.gz
libsolv-9479459e0d255af627f0310b2407b04d653fff3f.tar.bz2
libsolv-9479459e0d255af627f0310b2407b04d653fff3f.zip
cosmetics: always return 0 in selection_make if the selection is empty
Diffstat (limited to 'src/selection.c')
-rw-r--r--src/selection.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/selection.c b/src/selection.c
index 426b731..ffd2d0a 100644
--- a/src/selection.c
+++ b/src/selection.c
@@ -737,7 +737,8 @@ selection_make(Pool *pool, Queue *selection, const char *name, int flags)
ret = selection_depglob_arch(pool, selection, name, flags);
if (!ret && (flags & SELECTION_CANON) != 0)
ret = selection_canon(pool, selection, name, flags);
-
+ if (ret && !selection->count)
+ ret = 0; /* no match -> always return zero */
if (ret && (flags & SELECTION_FLAT) != 0)
selection_flatten(pool, selection);
return ret;