From 781ce7f4a8720515cce8e93db9145434b7bb515d Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 14 Aug 1992 16:37:50 +0000 Subject: Formerly arscan.c.~25~ --- arscan.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arscan.c b/arscan.c index 82188fe..18f182c 100644 --- a/arscan.c +++ b/arscan.c @@ -308,12 +308,16 @@ ar_name_equal (name, mem) namelen = strlen (name); memlen = strlen (mem); + if (namelen > memlen && memlen >= max - 1 && name[namelen - 2] == '.' && name[namelen - 1] == 'o' && mem[memlen - 2] == '.' && mem[memlen - 1] == 'o') return 1; - return !strcmp (name + max - 3, mem + max - 3); + if (namelen != memlen) + return 0; + + return (namelen < max - 3 || !strcmp (name + max - 3, mem + max - 3)); } #else /* AIX or APOLLO. */ -- cgit v1.2.3