From 1e8c1aa5752b38209bb521578377cd2025773e62 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Sat, 6 Apr 2024 16:34:38 +0200 Subject: 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 --- .../binutils-config/binutils-config-5.1-r11.ebuild | 85 ---------------------- .../binutils-config/binutils-config-5.1-r12.ebuild | 85 ++++++++++++++++++++++ sys-devel/binutils-config/files/ldwrapper.c | 22 ++++-- 3 files changed, 100 insertions(+), 92 deletions(-) delete mode 100644 sys-devel/binutils-config/binutils-config-5.1-r11.ebuild create mode 100644 sys-devel/binutils-config/binutils-config-5.1-r12.ebuild diff --git a/sys-devel/binutils-config/binutils-config-5.1-r11.ebuild b/sys-devel/binutils-config/binutils-config-5.1-r11.ebuild deleted file mode 100644 index 38f82d40b5..0000000000 --- a/sys-devel/binutils-config/binutils-config-5.1-r11.ebuild +++ /dev/null @@ -1,85 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -inherit eutils prefix - -DESCRIPTION="Utility to change the binutils version being used" -HOMEPAGE="https://www.gentoo.org/" -WRAPPER_REV="${PV%%.*}.3.4" -#SRC_URI="https://gitweb.gentoo.org/repo/proj/prefix.git/plain/sys-devel/binutils-config/files/ldwrapper.c?id=${GIT_REV} -> ${PN}-ldwrapper-${WRAPPER_REV}.c" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" -IUSE="" - -# We also RDEPEND on sys-apps/findutils which is in base @system -RDEPEND="sys-apps/gentoo-functions - ! @@ -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 */ -- cgit v1.2.3-65-gdbad