diff options
-rw-r--r-- | qlist.c | 7 | ||||
-rwxr-xr-x | tests/qlist/dotest | 3 | ||||
-rw-r--r-- | tests/qlist/list16.good | 1 |
3 files changed, 9 insertions, 2 deletions
@@ -183,8 +183,11 @@ qlist_match(q_vdb_pkg_ctx *pkg_ctx, const char *name, depend_atom **name_atom, b } if (uslot) { - /* require exact match on SLOTs */ - if (strncmp(pkg_ctx->slot, uslot, uslot_len) != 0 || pkg_ctx->slot[uslot_len] != '\0') + /* Require exact match on SLOTs. If the user didn't include a subslot, + * then ignore it when checking the package's value. */ + if (strncmp(pkg_ctx->slot, uslot, uslot_len) != 0 || + (pkg_ctx->slot[uslot_len] != '\0' && + pkg_ctx->slot[uslot_len] != '/')) return false; } diff --git a/tests/qlist/dotest b/tests/qlist/dotest index ddcd7616..317a2826 100755 --- a/tests/qlist/dotest +++ b/tests/qlist/dotest @@ -67,6 +67,9 @@ test 14 0 "qlist -ICSS" # no matches test 15 1 "qlist -Iv lajsdflkjasdflkjasdfljasdf" +# match test w/out sub-SLOT +test 16 0 "qlist -ICSS cat/sub-2:1" + cleantmpdir end diff --git a/tests/qlist/list16.good b/tests/qlist/list16.good new file mode 100644 index 00000000..9c27e9c8 --- /dev/null +++ b/tests/qlist/list16.good @@ -0,0 +1 @@ +cat/sub:1/1234 |