From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id E5378158086 for ; Sat, 9 Oct 2021 12:13:45 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 46562E07D8; Sat, 9 Oct 2021 12:13:45 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2EAC8E07D8 for ; Sat, 9 Oct 2021 12:13:45 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4C727342ECE for ; Sat, 9 Oct 2021 12:13:44 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id DB4A6EC for ; Sat, 9 Oct 2021 12:13:42 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1633781531.023d4496ef445a2f6f05b9c288e9816695d6daf4.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: libq/ X-VCS-Repository: proj/portage-utils X-VCS-Files: libq/atom.c X-VCS-Directories: libq/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 023d4496ef445a2f6f05b9c288e9816695d6daf4 X-VCS-Branch: master Date: Sat, 9 Oct 2021 12:13:42 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 9a1e48a1-412f-4862-9fc1-c7d3491da09a X-Archives-Hash: 4fbca295ff12be90cc0edbb146088436 commit: 023d4496ef445a2f6f05b9c288e9816695d6daf4 Author: Fabian Groffen gentoo org> AuthorDate: Sat Oct 9 12:12:11 2021 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Sat Oct 9 12:12:11 2021 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=023d4496 libq/atom: perform correct SUBSLOT matching in compare fixup after ef14d5f7bb09b8a90e827262798ebd1fde58913a now SUBSLOT is never NULL, ensure we check it was explicitly set or not, which is what used to be NULL. Signed-off-by: Fabian Groffen gentoo.org> libq/atom.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libq/atom.c b/libq/atom.c index 9a51e22..0b5fcdd 100644 --- a/libq/atom.c +++ b/libq/atom.c @@ -572,7 +572,9 @@ atom_compare_flg(const depend_atom *data, const depend_atom *query, int flags) if (query->SLOT == NULL && data->SLOT == NULL) return NOT_EQUAL; if (query->SLOT != NULL) { - if (query->SUBSLOT == NULL || flags & ATOM_COMP_NOSUBSLOT) { + if (query->SUBSLOT == query->SLOT || + flags & ATOM_COMP_NOSUBSLOT) + { /* ^perl:0 -> match different SLOT */ if (data->SLOT == NULL || strcmp(query->SLOT, data->SLOT) == 0) @@ -583,7 +585,7 @@ atom_compare_flg(const depend_atom *data, const depend_atom *query, int flags) strcmp(query->SLOT, data->SLOT) != 0) return NOT_EQUAL; if (!(flags & ATOM_COMP_NOSUBSLOT)) - if (data->SUBSLOT == NULL || + if (data->SUBSLOT == query->SLOT || strcmp(query->SUBSLOT, data->SUBSLOT) == 0) return NOT_EQUAL; } @@ -601,8 +603,8 @@ atom_compare_flg(const depend_atom *data, const depend_atom *query, int flags) if (bl_op == ATOM_BL_NONE) return NOT_EQUAL; } else if (!(flags & ATOM_COMP_NOSUBSLOT)) { - if (query->SUBSLOT != NULL) { - if (data->SUBSLOT == NULL) { + if (query->SUBSLOT != query->SLOT) { + if (data->SUBSLOT == data->SLOT) { if (bl_op == ATOM_BL_NONE) return NOT_EQUAL; } else {