1 |
commit: d500e279f02bd5b58407975da145b1334c33e696 |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Sep 26 13:22:24 2019 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Sep 26 13:22:24 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=d500e279 |
7 |
|
8 |
libq/tree: simplify atom construction in tree_get_atoms_cb |
9 |
|
10 |
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> |
11 |
|
12 |
libq/tree.c | 7 +++---- |
13 |
1 file changed, 3 insertions(+), 4 deletions(-) |
14 |
|
15 |
diff --git a/libq/tree.c b/libq/tree.c |
16 |
index f8d90ce..8caed00 100644 |
17 |
--- a/libq/tree.c |
18 |
+++ b/libq/tree.c |
19 |
@@ -1061,10 +1061,9 @@ static int tree_get_atoms_cb(tree_pkg_ctx *pkg_ctx, void *priv) |
20 |
char abuf[BUFSIZ]; |
21 |
|
22 |
if (state->fullcpv) { |
23 |
- size_t len = snprintf(abuf, sizeof(abuf), "%s/%s-%s", |
24 |
- atom->CATEGORY, atom->PN, atom->PV); |
25 |
- if (atom->PR_int > 0) |
26 |
- snprintf(abuf + len, sizeof(abuf) - len, "-r%d", atom->PR_int); |
27 |
+ snprintf(abuf, sizeof(abuf), "%s/%s-%s", |
28 |
+ atom->CATEGORY, atom->PN, |
29 |
+ atom->PR_int > 0 ? atom->PVR : atom->PV); |
30 |
state->cpf = add_set(abuf, state->cpf); |
31 |
} else { |
32 |
snprintf(abuf, sizeof(abuf), "%s/%s", atom->CATEGORY, atom->PN); |