From 1f1845d435fd0886f5c5561df8922268d2dfaefc Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 5 Oct 2020 16:09:00 +0100 Subject: [PATCH] Fix compile time error building windmc, detected by gcc 11. PR 26698 * windmc.c (mc_unify_path): Fix typo checking character at end of pathname. --- binutils/ChangeLog | 6 ++++++ binutils/windmc.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 9d906649f0a..f5411e3fb3a 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,9 @@ +2020-10-05 Nick Clifton + + PR 26698 + * windmc.c (mc_unify_path): Fix typo checking character at end of + pathname. + 2020-10-05 Samanta Navarro * doc/binutils.texi: Fix spelling mistakes. diff --git a/binutils/windmc.c b/binutils/windmc.c index 98bb3ad6908..3b9d2aa48f1 100644 --- a/binutils/windmc.c +++ b/binutils/windmc.c @@ -924,7 +924,7 @@ mc_unify_path (const char *path) hsz = xmalloc (strlen (path) + 2); strcpy (hsz, path); end = hsz + strlen (hsz); - if (hsz[-1] != '/' && hsz[-1] != '\\') + if (end[-1] != '/' && end[-1] != '\\') strcpy (end, "/"); while ((end = strchr (hsz, '\\')) != NULL) *end = '/'; -- 2.30.2