From: Paul Smith Date: Mon, 23 Sep 2019 04:34:12 +0000 (-0400) Subject: * src/function.c (func_realpath) [AIX]: Remove trailing slashes. X-Git-Tag: 4.2.92~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0e113897f70a96a7711ae26cd41b534adedd10e3;p=thirdparty%2Fmake.git * src/function.c (func_realpath) [AIX]: Remove trailing slashes. --- diff --git a/src/function.c b/src/function.c index adef7e6f..4ebff168 100644 --- a/src/function.c +++ b/src/function.c @@ -2173,6 +2173,15 @@ func_realpath (char *o, char **argv, const char *funcname UNUSED) #ifdef HAVE_REALPATH ENULLLOOP (rp, realpath (in, out)); +# if defined _AIX + /* AIX realpath() doesn't remove trailing slashes correctly. */ + if (rp) + { + char *ep = rp + strlen (rp) - 1; + while (ep > rp && ep[0] == '/') + *(ep--) = '\0'; + } +# endif #else rp = abspath (in, out); #endif