cosmetics: always return 0 in selection_make if the selection is empty
authorMichael Schroeder <mls@suse.de>
Tue, 12 Feb 2013 19:02:04 +0000 (20:02 +0100)
committerMichael Schroeder <mls@suse.de>
Tue, 12 Feb 2013 19:02:04 +0000 (20:02 +0100)
src/selection.c

index 426b731..ffd2d0a 100644 (file)
@@ -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;