From: Nick Clifton Date: Mon, 5 Oct 2020 15:09:00 +0000 (+0100) Subject: Fix compile time error building windmc, detected by gcc 11. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1f1845d435fd0886f5c5561df8922268d2dfaefc;p=binutils-gdb.git 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. --- 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 = '/';