diff options
author | Fabian Groffen <grobian@gentoo.org> | 2008-10-19 18:11:59 +0000 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2008-10-19 18:11:59 +0000 |
commit | c18cd4516dcf9d8a5659f30260af9638ceaacff3 (patch) | |
tree | 6319e844da26c2e211e56e10e752038dbafa2964 /scanmacho.c | |
parent | fix manpage, the same fix is needed for scanelf, but I don't dare to commit that (diff) | |
download | pax-utils-c18cd4516dcf9d8a5659f30260af9638ceaacff3.tar.gz pax-utils-c18cd4516dcf9d8a5659f30260af9638ceaacff3.tar.bz2 pax-utils-c18cd4516dcf9d8a5659f30260af9638ceaacff3.zip |
Made reading archives work.
The Darwin linker creates BSD ar archives, which (stupidly) always use
the "extended filename" method to store filenames. For this reason I
implemented the BSD extended filename method in paxinc's ar_next.
Next to some fixes in the macho code not to free and unmap when this is
not desired, this yields in a working scanmacho on static archives.
The change has been checked with scanelf against a GNU ELF static
archive not to break anything.
Diffstat (limited to 'scanmacho.c')
-rw-r--r-- | scanmacho.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scanmacho.c b/scanmacho.c index 2346b67..c2649f8 100644 --- a/scanmacho.c +++ b/scanmacho.c @@ -1,7 +1,7 @@ /* * Copyright 2008 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanmacho.c,v 1.4 2008/09/12 19:59:26 grobian Exp $ + * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanmacho.c,v 1.5 2008/10/19 18:11:59 grobian Exp $ * * based on scanelf by: * Copyright 2003-2007 Ned Ludd - <solar@gentoo.org> @@ -10,7 +10,7 @@ * 2008 Fabian Groffen - <grobian@gentoo.org> */ -static const char *rcsid = "$Id: scanmacho.c,v 1.4 2008/09/12 19:59:26 grobian Exp $"; +static const char *rcsid = "$Id: scanmacho.c,v 1.5 2008/10/19 18:11:59 grobian Exp $"; const char * const argv0 = "scanmacho"; #include "paxinc.h" @@ -404,6 +404,7 @@ static int scanmacho_archive(const char *filename, int fd, size_t len) do { scanmacho_fatobj(walk); } while (walk->next != NULL && (walk = walk->next)); + fobj->data = NULL; unreadmacho(fobj); } } |