commit:     3f80f07a5bfa87481f1360f7b59649a03c547446
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Wed Jan  7 21:20:55 2026 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Wed Jan  7 21:20:55 2026 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=3f80f07a

libq/atom: fix two issues in atom_clone

- retain version suffix (instead of duplicating the prefix)
- copy usedeps into the new atom (iso old, thus loose it)

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 libq/atom.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libq/atom.c b/libq/atom.c
index c3c0be7..76e0743 100644
--- a/libq/atom.c
+++ b/libq/atom.c
@@ -491,7 +491,7 @@ atom_clone(depend_atom *atom)
 
        ret->blocker = atom->blocker;
        ret->pfx_op  = atom->pfx_op;
-       ret->sfx_op  = atom->pfx_op;
+       ret->sfx_op  = atom->sfx_op;
        ret->PR_int  = atom->PR_int;
        ret->letter  = atom->letter;
        ret->slotdep = atom->slotdep;
@@ -512,7 +512,7 @@ atom_clone(depend_atom *atom)
                for (w = atom->usedeps; w != NULL; w = w->next) {
                        nlen = w->use != NULL ? strlen(w->use) + 1 : 0;
                        if (n == NULL) {
-                               atom->usedeps = n = xmalloc(sizeof(*n) + nlen);
+                               ret->usedeps = n = xmalloc(sizeof(*n) + nlen);
                        } else {
                                n = n->next = xmalloc(sizeof(*n) + nlen);
                        }

Reply via email to