From 16aec39ebeb2246b0a0d335d5f02f6e1ebca67d1 Mon Sep 17 00:00:00 2001 From: Paul Fox Date: Sat, 17 Nov 2007 19:11:05 +0000 Subject: [PATCH] add comment clarifying busybox's use of non-standard tar header --- archival/libunarchive/get_header_tar.c | 3 +++ archival/tar.c | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/archival/libunarchive/get_header_tar.c b/archival/libunarchive/get_header_tar.c index bbf088cd8..274bd4607 100644 --- a/archival/libunarchive/get_header_tar.c +++ b/archival/libunarchive/get_header_tar.c @@ -61,6 +61,9 @@ char get_header_tar(archive_handle_t *archive_handle) char linkname[100]; /* 157-256 */ /* POSIX: "ustar" NUL "00" */ /* GNU tar: "ustar " NUL */ + /* Normally it's defined as magic[6] followed by + * version[2], but we put them together to save code. + */ char magic[8]; /* 257-264 */ char uname[32]; /* 265-296 */ char gname[32]; /* 297-328 */ diff --git a/archival/tar.c b/archival/tar.c index bbde88a57..5b19093e8 100644 --- a/archival/tar.c +++ b/archival/tar.c @@ -52,13 +52,16 @@ struct TarHeader { /* byte offset */ char linkname[NAME_SIZE]; /* 157-256 */ /* POSIX: "ustar" NUL "00" */ /* GNU tar: "ustar " NUL */ + /* Normally it's defined as magic[6] followed by + * version[2], but we put them together to save code. + */ char magic[8]; /* 257-264 */ char uname[32]; /* 265-296 */ char gname[32]; /* 297-328 */ char devmajor[8]; /* 329-336 */ char devminor[8]; /* 337-344 */ char prefix[155]; /* 345-499 */ - char padding[12]; /* 500-512 (pad to exactly the TAR_BLOCK_SIZE) */ + char padding[12]; /* 500-512 (pad to exactly TAR_BLOCK_SIZE) */ }; /* -- 2.25.1