From ef6f50088f40147e92b055495ec126fc4fb117f7 Mon Sep 17 00:00:00 2001 From: bebbo Date: Thu, 29 Sep 2022 08:21:05 +0200 Subject: [PATCH] refs #189: don't trash q - it's needed later --- libiberty/make-relative-prefix.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libiberty/make-relative-prefix.c b/libiberty/make-relative-prefix.c index bcb64c2d355..1c185fb08ea 100644 --- a/libiberty/make-relative-prefix.c +++ b/libiberty/make-relative-prefix.c @@ -266,7 +266,7 @@ make_relative_prefix_1 (const char *progname, const char *bin_prefix, int i, n, common; int needed_len; char *ret = NULL, *ptr, *full_progname; - char buf[1024], *p, *q; + char buf[1024], *p, *q, *t; DIR * d; if (progname == NULL || bin_prefix == NULL || prefix == NULL) @@ -325,14 +325,14 @@ make_relative_prefix_1 (const char *progname, const char *bin_prefix, #endif // normalize - while ((q = strstr(p, "/../"))) + while ((t = strstr(p, "/../"))) { - char * r = q - 1; + char * r = t - 1; while (r >= p && *r != '/') --r; if (r < p) break; - memmove(r, q + 3, strlen(q + 3) + 1); + memmove(r, t + 3, strlen(t + 3) + 1); }