summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/arch.c
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2005-03-03 10:46:23 +0000
committerharti <harti@FreeBSD.org>2005-03-03 10:46:23 +0000
commitbed0867bba953572a2ce524b670548c8b76b7698 (patch)
treef028f90eb9dc7b914cf86d99222e0b9c52825efc /usr.bin/make/arch.c
parente40b6c387575a6f387af914fe8aaf548fab21ea4 (diff)
downloadFreeBSD-src-bed0867bba953572a2ce524b670548c8b76b7698.zip
FreeBSD-src-bed0867bba953572a2ce524b670548c8b76b7698.tar.gz
Fix parsing of archives: in System V archive format the member names
is terminated with a slash. Although we are not System V, ar has been configured to put that slash in. This format allows filenames with trailing spaces.
Diffstat (limited to 'usr.bin/make/arch.c')
-rw-r--r--usr.bin/make/arch.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/make/arch.c b/usr.bin/make/arch.c
index 8276fbb..2565c07 100644
--- a/usr.bin/make/arch.c
+++ b/usr.bin/make/arch.c
@@ -516,10 +516,12 @@ ArchFindMember(const char *archive, const char *member, struct ar_hdr *arhPtr,
* prefixes. Names are space-padded to the right, so if
* the character in 'name' at the end of the matched
* string is anything but a space, this isn't the
- * member we sought.
+ * member we sought. Additionally there may be a
+ * slash at the end of the name (System 5 style).
*/
if (tlen != sizeof(arhPtr->ar_name) &&
- arhPtr->ar_name[tlen] != ' '){
+ arhPtr->ar_name[tlen] != ' ' &&
+ arhPtr->ar_name[tlen] != '/') {
goto skip;
}
/*
OpenPOWER on IntegriCloud