* src/arscan.c (ar_name_equal): Support GNU ar's -P option.

This commit is contained in:
Marco Sirabella 2024-03-24 16:41:13 -04:00 committed by Paul Smith
parent 882d59c672
commit 0b91f42f58

View File

@ -852,6 +852,11 @@ ar_name_equal (const char *name, const char *mem, int truncated)
{ {
const char *p; 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, '/'); p = strrchr (name, '/');
if (p != 0) if (p != 0)
name = p + 1; name = p + 1;