]> git.ipfire.org Git - thirdparty/make.git/commitdiff
* src/function.c (func_realpath) [AIX]: Remove trailing slashes.
authorPaul Smith <psmith@gnu.org>
Mon, 23 Sep 2019 04:34:12 +0000 (00:34 -0400)
committerPaul Smith <psmith@gnu.org>
Mon, 23 Sep 2019 04:34:12 +0000 (00:34 -0400)
src/function.c

index adef7e6fc179db64a7e7aa30f58c9601ed4b522c..4ebff168934508267452ef3b5f128fcb98777226 100644 (file)
@@ -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