diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-01-09 19:10:49 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-01-09 19:10:49 +0100 |
commit | dc698bb038756a926aaa529bda1b939eab2c1676 (patch) | |
tree | 4084a40897d9d81816228935a1398e80dd4b173b /archival/libunarchive | |
parent | 0681137972dc89b5003b0415e09184c0ecf1c875 (diff) | |
download | busybox-w32-dc698bb038756a926aaa529bda1b939eab2c1676.tar.gz busybox-w32-dc698bb038756a926aaa529bda1b939eab2c1676.tar.bz2 busybox-w32-dc698bb038756a926aaa529bda1b939eab2c1676.zip |
*: make it easier to distinquish "struct tm", pointer to one, etc
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival/libunarchive')
-rw-r--r-- | archival/libunarchive/header_verbose_list.c | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/archival/libunarchive/header_verbose_list.c b/archival/libunarchive/header_verbose_list.c index da21a15af..f6f04cfd5 100644 --- a/archival/libunarchive/header_verbose_list.c +++ b/archival/libunarchive/header_verbose_list.c | |||
@@ -8,7 +8,8 @@ | |||
8 | 8 | ||
9 | void FAST_FUNC header_verbose_list(const file_header_t *file_header) | 9 | void FAST_FUNC header_verbose_list(const file_header_t *file_header) |
10 | { | 10 | { |
11 | struct tm *mtime = localtime(&(file_header->mtime)); | 11 | struct tm tm_time; |
12 | struct tm *ptm = &tm_time; //localtime(&file_header->mtime); | ||
12 | 13 | ||
13 | #if ENABLE_FEATURE_TAR_UNAME_GNAME | 14 | #if ENABLE_FEATURE_TAR_UNAME_GNAME |
14 | char uid[sizeof(int)*3 + 2]; | 15 | char uid[sizeof(int)*3 + 2]; |
@@ -16,6 +17,8 @@ void FAST_FUNC header_verbose_list(const file_header_t *file_header) | |||
16 | char *user; | 17 | char *user; |
17 | char *group; | 18 | char *group; |
18 | 19 | ||
20 | localtime_r(&file_header->mtime, ptm); | ||
21 | |||
19 | user = file_header->tar__uname; | 22 | user = file_header->tar__uname; |
20 | if (user == NULL) { | 23 | if (user == NULL) { |
21 | sprintf(uid, "%u", (unsigned)file_header->uid); | 24 | sprintf(uid, "%u", (unsigned)file_header->uid); |
@@ -31,26 +34,31 @@ void FAST_FUNC header_verbose_list(const file_header_t *file_header) | |||
31 | user, | 34 | user, |
32 | group, | 35 | group, |
33 | file_header->size, | 36 | file_header->size, |
34 | 1900 + mtime->tm_year, | 37 | 1900 + ptm->tm_year, |
35 | 1 + mtime->tm_mon, | 38 | 1 + ptm->tm_mon, |
36 | mtime->tm_mday, | 39 | ptm->tm_mday, |
37 | mtime->tm_hour, | 40 | ptm->tm_hour, |
38 | mtime->tm_min, | 41 | ptm->tm_min, |
39 | mtime->tm_sec, | 42 | ptm->tm_sec, |
40 | file_header->name); | 43 | file_header->name); |
44 | |||
41 | #else /* !FEATURE_TAR_UNAME_GNAME */ | 45 | #else /* !FEATURE_TAR_UNAME_GNAME */ |
46 | |||
47 | localtime_r(&file_header->mtime, ptm); | ||
48 | |||
42 | printf("%s %u/%u %9"OFF_FMT"u %4u-%02u-%02u %02u:%02u:%02u %s", | 49 | printf("%s %u/%u %9"OFF_FMT"u %4u-%02u-%02u %02u:%02u:%02u %s", |
43 | bb_mode_string(file_header->mode), | 50 | bb_mode_string(file_header->mode), |
44 | (unsigned)file_header->uid, | 51 | (unsigned)file_header->uid, |
45 | (unsigned)file_header->gid, | 52 | (unsigned)file_header->gid, |
46 | file_header->size, | 53 | file_header->size, |
47 | 1900 + mtime->tm_year, | 54 | 1900 + ptm->tm_year, |
48 | 1 + mtime->tm_mon, | 55 | 1 + ptm->tm_mon, |
49 | mtime->tm_mday, | 56 | ptm->tm_mday, |
50 | mtime->tm_hour, | 57 | ptm->tm_hour, |
51 | mtime->tm_min, | 58 | ptm->tm_min, |
52 | mtime->tm_sec, | 59 | ptm->tm_sec, |
53 | file_header->name); | 60 | file_header->name); |
61 | |||
54 | #endif /* FEATURE_TAR_UNAME_GNAME */ | 62 | #endif /* FEATURE_TAR_UNAME_GNAME */ |
55 | 63 | ||
56 | if (file_header->link_target) { | 64 | if (file_header->link_target) { |