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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 1E448158041 for ; Sat, 6 Apr 2024 14:36:39 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4018AE29E4; Sat, 6 Apr 2024 14:36:38 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 22BADE29E4 for ; Sat, 6 Apr 2024 14:36:37 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0F31F3432D5 for ; Sat, 6 Apr 2024 14:36:37 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 94D55161F for ; Sat, 6 Apr 2024 14:36:35 +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: <1712414078.1e8c1aa5752b38209bb521578377cd2025773e62.grobian@gentoo> Subject: [gentoo-commits] repo/proj/prefix:master commit in: sys-devel/binutils-config/files/, sys-devel/binutils-config/ X-VCS-Repository: repo/proj/prefix X-VCS-Files: sys-devel/binutils-config/binutils-config-5.1-r11.ebuild sys-devel/binutils-config/binutils-config-5.1-r12.ebuild sys-devel/binutils-config/files/ldwrapper.c X-VCS-Directories: sys-devel/binutils-config/files/ sys-devel/binutils-config/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 1e8c1aa5752b38209bb521578377cd2025773e62 X-VCS-Branch: master Date: Sat, 6 Apr 2024 14:36:35 +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: 31587124-3296-4b8e-8af3-c47589c1877d X-Archives-Hash: 7c92818e16093d3b269354dc3810edf0 commit: 1e8c1aa5752b38209bb521578377cd2025773e62 Author: Fabian Groffen gentoo org> AuthorDate: Sat Apr 6 14:34:38 2024 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Sat Apr 6 14:34:38 2024 +0000 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=1e8c1aa5 sys-devel/binutils-config: fix -rpath and -L handling A thinko broke skipping of arguments consisting of two entries, resulting in very weird command lines. Not noticed on Darwin because for some odd reason. Signed-off-by: Fabian Groffen gentoo.org> ...1-r11.ebuild => binutils-config-5.1-r12.ebuild} | 0 sys-devel/binutils-config/files/ldwrapper.c | 22 +++++++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/sys-devel/binutils-config/binutils-config-5.1-r11.ebuild b/sys-devel/binutils-config/binutils-config-5.1-r12.ebuild similarity index 100% rename from sys-devel/binutils-config/binutils-config-5.1-r11.ebuild rename to sys-devel/binutils-config/binutils-config-5.1-r12.ebuild diff --git a/sys-devel/binutils-config/files/ldwrapper.c b/sys-devel/binutils-config/files/ldwrapper.c index 22fbf9aba8..1aa96537d0 100644 --- a/sys-devel/binutils-config/files/ldwrapper.c +++ b/sys-devel/binutils-config/files/ldwrapper.c @@ -530,7 +530,7 @@ main(int argc, char *argv[]) char *path; int pth; char duplicate; - int before = j - 1; + int nexti = i; /* arguments can be in many ways here: * -L @@ -541,10 +541,11 @@ main(int argc, char *argv[]) while (*path != '\0' && isspace(*path)) path++; if (*path == '\0') { + nexti++; /* no more arguments?!? skip */ - if (i + 1 >= argc) + if (nexti >= argc) continue; - path = argv[i + 1]; + path = argv[nexti]; while (*path != '\0' && isspace(*path)) path++; } @@ -570,7 +571,8 @@ main(int argc, char *argv[]) } } if (duplicate) { - j = before; + i = nexti; + j--; continue; } /* record path */ @@ -584,7 +586,8 @@ main(int argc, char *argv[]) } } if (duplicate) { - j = before; + i = nexti; + j--; continue; } /* record path */ @@ -597,8 +600,12 @@ main(int argc, char *argv[]) char *path; int pth; char duplicate; + int nexti = i + 1; - path = argv[i + 1]; + /* no more arguments?!? skip */ + if (nexti >= argc) + continue; + path = argv[nexti]; while (*path != '\0' && isspace(*path)) path++; /* not absolute (or empty)?!? skip */ @@ -617,7 +624,8 @@ main(int argc, char *argv[]) } } if (duplicate) { - j -= 2; + j--; + i = nexti; continue; } /* record path */