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 9BF1F138334 for ; Fri, 27 Dec 2019 21:45:57 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BAD52E0B4B; Fri, 27 Dec 2019 21:45:56 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 94D87E0B4B for ; Fri, 27 Dec 2019 21:45:56 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7AF1334DBF9 for ; Fri, 27 Dec 2019 21:45:55 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8A53D34 for ; Fri, 27 Dec 2019 21:45:53 +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: <1577483086.eddd1df90bc5d27e726c02e8aac8cfa9484ed3a8.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: / X-VCS-Repository: proj/portage-utils X-VCS-Files: qfile.c X-VCS-Directories: / X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: eddd1df90bc5d27e726c02e8aac8cfa9484ed3a8 X-VCS-Branch: master Date: Fri, 27 Dec 2019 21:45:53 +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: 07dbe37f-c950-48d3-be63-accbce5609ff X-Archives-Hash: ac3d4851f77496835238ffc3b8b6008a commit: eddd1df90bc5d27e726c02e8aac8cfa9484ed3a8 Author: Fabian Groffen gentoo org> AuthorDate: Fri Dec 27 21:44:46 2019 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Fri Dec 27 21:44:46 2019 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=eddd1df9 qfile: make qfile_check_plibreg not trigger on an empty file (/) This really is an edge case, as result of a misinterpretation of the -R option. Bug: https://bugs.gentoo.org/699558 Signed-off-by: Fabian Groffen gentoo.org> qfile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qfile.c b/qfile.c index 6c2ebb8..b1aab8d 100644 --- a/qfile.c +++ b/qfile.c @@ -119,7 +119,7 @@ static int qfile_check_plibreg(void *priv) } for (i = 0; i < args->length; i++) { - if (base_names[i] == NULL) + if (base_names[i] == NULL || base_names[i][0] == '\0') continue; if (non_orphans && non_orphans[i]) continue; @@ -534,7 +534,7 @@ int qfile_main(int argc, char **argv) * (this one is just for qfile(...) output) */ size_t lastc = strlen(portroot) - 1; state.root = xstrdup(portroot); - if (state.root[lastc] == '/') + if (lastc > 0 && state.root[lastc] == '/') state.root[lastc] = '\0'; }