From f0b329da20468a40c025565b160d3928b737a354 Mon Sep 17 00:00:00 2001 From: Greg Beaver Date: Sun, 9 Mar 2008 04:17:20 +0000 Subject: [PATCH] pack tar structs so speed optimizations don't add extra bytes to the header # Steph: try this and see if it fixes Bug #13353 --- ext/phar/tar.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ext/phar/tar.h b/ext/phar/tar.h index 3757da805c9..c7ecde5bb1e 100644 --- a/ext/phar/tar.h +++ b/ext/phar/tar.h @@ -19,6 +19,12 @@ +----------------------------------------------------------------------+ */ +#ifdef PHP_WIN32 +#pragma pack(1) +# define PHAR_TAR_PACK +#else +# define PHAR_TAR_PACK __attribute__((__packed__)) +#endif /** * the format of the header block for a file, in the older UNIX-compatible * TAR format @@ -37,7 +43,7 @@ typedef struct _old_tar_header { /* {{{ */ 2 for a symbolic link, 0 otherwise */ char linkname[100]; /* name of linked file */ -} old_tar_header; +} PHAR_TAR_PACK old_tar_header; /* }}} */ /** @@ -74,7 +80,7 @@ typedef struct _tar_header { /* {{{ */ is prefixed to the name field to allow names longer then 100 characters */ char padding[12]; /* unused zeroed bytes */ -} tar_header; +} PHAR_TAR_PACK tar_header; /* }}} */ #endif