]> git.ipfire.org Git - thirdparty/make.git/commitdiff
* src/arscan.c (ar_name_equal): Support GNU ar's -P option.
authorMarco Sirabella <marco@sirabella.org>
Sun, 24 Mar 2024 20:41:13 +0000 (16:41 -0400)
committerPaul Smith <psmith@gnu.org>
Thu, 28 Mar 2024 23:08:13 +0000 (19:08 -0400)
src/arscan.c

index 00225410ffe34f1c116dbf9f7a3432bc8efbca4e..eed90c802cd31c5b47343003c20546de807adfd2 100644 (file)
@@ -852,6 +852,11 @@ ar_name_equal (const char *name, const char *mem, int truncated)
 {
   const char *p;
 
+  /* GNU ar allows -P to preserve parent paths, so test the literal name
+     before stripping off the directory.  */
+  if (streq (name, mem))
+    return 1;
+
   p = strrchr (name, '/');
   if (p != 0)
     name = p + 1;