1 |
commit: 023d4496ef445a2f6f05b9c288e9816695d6daf4 |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Oct 9 12:12:11 2021 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Oct 9 12:12:11 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=023d4496 |
7 |
|
8 |
libq/atom: perform correct SUBSLOT matching in compare |
9 |
|
10 |
fixup after ef14d5f7bb09b8a90e827262798ebd1fde58913a |
11 |
now SUBSLOT is never NULL, ensure we check it was explicitly set or not, |
12 |
which is what used to be NULL. |
13 |
|
14 |
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> |
15 |
|
16 |
libq/atom.c | 10 ++++++---- |
17 |
1 file changed, 6 insertions(+), 4 deletions(-) |
18 |
|
19 |
diff --git a/libq/atom.c b/libq/atom.c |
20 |
index 9a51e22..0b5fcdd 100644 |
21 |
--- a/libq/atom.c |
22 |
+++ b/libq/atom.c |
23 |
@@ -572,7 +572,9 @@ atom_compare_flg(const depend_atom *data, const depend_atom *query, int flags) |
24 |
if (query->SLOT == NULL && data->SLOT == NULL) |
25 |
return NOT_EQUAL; |
26 |
if (query->SLOT != NULL) { |
27 |
- if (query->SUBSLOT == NULL || flags & ATOM_COMP_NOSUBSLOT) { |
28 |
+ if (query->SUBSLOT == query->SLOT || |
29 |
+ flags & ATOM_COMP_NOSUBSLOT) |
30 |
+ { |
31 |
/* ^perl:0 -> match different SLOT */ |
32 |
if (data->SLOT == NULL || |
33 |
strcmp(query->SLOT, data->SLOT) == 0) |
34 |
@@ -583,7 +585,7 @@ atom_compare_flg(const depend_atom *data, const depend_atom *query, int flags) |
35 |
strcmp(query->SLOT, data->SLOT) != 0) |
36 |
return NOT_EQUAL; |
37 |
if (!(flags & ATOM_COMP_NOSUBSLOT)) |
38 |
- if (data->SUBSLOT == NULL || |
39 |
+ if (data->SUBSLOT == query->SLOT || |
40 |
strcmp(query->SUBSLOT, data->SUBSLOT) == 0) |
41 |
return NOT_EQUAL; |
42 |
} |
43 |
@@ -601,8 +603,8 @@ atom_compare_flg(const depend_atom *data, const depend_atom *query, int flags) |
44 |
if (bl_op == ATOM_BL_NONE) |
45 |
return NOT_EQUAL; |
46 |
} else if (!(flags & ATOM_COMP_NOSUBSLOT)) { |
47 |
- if (query->SUBSLOT != NULL) { |
48 |
- if (data->SUBSLOT == NULL) { |
49 |
+ if (query->SUBSLOT != query->SLOT) { |
50 |
+ if (data->SUBSLOT == data->SLOT) { |
51 |
if (bl_op == ATOM_BL_NONE) |
52 |
return NOT_EQUAL; |
53 |
} else { |