From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id EDA0613888F for ; Thu, 15 Oct 2015 22:01:00 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AD28921C0CD; Thu, 15 Oct 2015 22:00:52 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5642121C0CD for ; Thu, 15 Oct 2015 22:00:52 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 718B9340BE3 for ; Thu, 15 Oct 2015 22:00:48 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8858C10B1 for ; Thu, 15 Oct 2015 22:00:46 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1444942939.153e9ff8bec2ec4cd1e777ee4b24e477a716ee87.vapier@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: libq/ X-VCS-Repository: proj/portage-utils X-VCS-Files: libq/atom_explode.c X-VCS-Directories: libq/ X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 153e9ff8bec2ec4cd1e777ee4b24e477a716ee87 X-VCS-Branch: master Date: Thu, 15 Oct 2015 22:00:46 +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-Archives-Salt: 4bcf41c9-8b64-4309-a337-3e8c6b76d402 X-Archives-Hash: 70c68de2e1cfa695c95c66f5b65a6899 commit: 153e9ff8bec2ec4cd1e777ee4b24e477a716ee87 Author: Mike Frysinger gentoo org> AuthorDate: Thu Oct 15 20:54:30 2015 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Thu Oct 15 21:02:19 2015 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=153e9ff8 atom_explode: fix setup of PVR Tests are included in the next commit. libq/atom_explode.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libq/atom_explode.c b/libq/atom_explode.c index 9eb5695..2855246 100644 --- a/libq/atom_explode.c +++ b/libq/atom_explode.c @@ -161,7 +161,6 @@ depend_atom *atom_explode(const char *atom) ret->PN = ret->CATEGORY; ret->CATEGORY = NULL; } - strcpy(ret->PVR, ret->PN); /* find -r# */ ptr = ret->PN + strlen(ret->PN) - 1; @@ -170,8 +169,7 @@ depend_atom *atom_explode(const char *atom) if (ptr[0] == 'r' && ptr[-1] == '-') { ret->PR_int = atoi(ptr + 1); ptr[-1] = '\0'; - } else - strcat(ret->PVR, "-r0"); + } break; } --ptr; @@ -236,6 +234,8 @@ depend_atom *atom_explode(const char *atom) break; if (has_pv) { ret->PV = ret->P + (ptr - ret->PN) + 1; + ptr = stpcpy(ret->PVR, ret->PV); + sprintf(ptr, "-r%i", ret->PR_int); } else { /* atom has no version */ ret->PV = ret->PVR = NULL;