aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2024-08-17 01:59:30 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2024-08-17 20:40:43 -0400
commit60a25a7bf8aad7bd46d4a3b22342998b6bca4e94 (patch)
treefe1233755290c66b8decdb30466c9427a2d7ccd7
parentae684b62a7ca4522acabb1e74f6b5651f5821233 (diff)
downloadstasis-60a25a7bf8aad7bd46d4a3b22342998b6bca4e94.tar.gz
Bugfix: Avoid incorrect package selection
* With large package lists that contain multiple packages starting with the same strstr() would pick the first match * This adds a temporary name variable that strcmp() can check against.
-rw-r--r--src/delivery.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/delivery.c b/src/delivery.c
index e6f9aa6..f460566 100644
--- a/src/delivery.c
+++ b/src/delivery.c
@@ -1473,7 +1473,7 @@ void delivery_defer_packages(struct Delivery *ctx, int type) {
strcpy(nametmp, name);
}
// Is the [test:NAME] in the package name?
- if (strstr(name, test->name)) {
+ if (!strcmp(nametmp, test->name)) {
// Override test->version when a version is provided by the (pip|conda)_package list item
guard_free(test->version);
if (spec_begin && spec_end) {