When archive files are created with gnu ar's P flag the parent paths of
saved files aren't stripped off. This is helpful when you're adding
multiple files to an archive with the same stem but different parent
paths.

Let's check if paths are directly equivalent before doing archive file
path normalization.

Note: ./build/whatever.o is still not equal to build/whatever.o in this
instance but this is somewhat inline with other make behaviour
---
 src/arscan.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/arscan.c b/src/arscan.c
index edd4070c..ea6a1300 100644
--- a/src/arscan.c
+++ b/src/arscan.c
@@ -852,6 +852,10 @@ ar_name_equal (const char *name, const char *mem, int 
truncated)
 {
   const char *p;
 
+  if (!strcmp(name,mem)) {
+      return 1;
+  }
+
   p = strrchr (name, '/');
   if (p != 0)
     name = p + 1;
-- 
2.43.0


Reply via email to