diff options
author | 2024-04-06 16:34:38 +0200 | |
---|---|---|
committer | 2024-04-06 16:34:38 +0200 | |
commit | 1e8c1aa5752b38209bb521578377cd2025773e62 (patch) | |
tree | 451f6d489d52da77f06a1a6012c605a3ea1be2fe | |
parent | scripts/bootstrap-prefix: bump snapshot for Darwin fixes (diff) | |
download | prefix-1e8c1aa5752b38209bb521578377cd2025773e62.tar.gz prefix-1e8c1aa5752b38209bb521578377cd2025773e62.tar.bz2 prefix-1e8c1aa5752b38209bb521578377cd2025773e62.zip |
sys-devel/binutils-config: fix -rpath and -L <arg> 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 <grobian@gentoo.org>
-rw-r--r-- | sys-devel/binutils-config/binutils-config-5.1-r12.ebuild (renamed from sys-devel/binutils-config/binutils-config-5.1-r11.ebuild) | 0 | ||||
-rw-r--r-- | 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 index 38f82d40b5..38f82d40b5 100644 --- a/sys-devel/binutils-config/binutils-config-5.1-r11.ebuild +++ b/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<path> @@ -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 */ |