diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-03-14 22:08:53 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-03-14 22:08:53 +0000 |
commit | 650a0459b87314fc412dc81a2a863fefb969ca37 (patch) | |
tree | 859f73e5644ef22a804a58537c95228fca0b266b | |
parent | 16c7fb7fc5ae647bcc273827f507d90866419560 (diff) | |
download | busybox-w32-650a0459b87314fc412dc81a2a863fefb969ca37.tar.gz busybox-w32-650a0459b87314fc412dc81a2a863fefb969ca37.tar.bz2 busybox-w32-650a0459b87314fc412dc81a2a863fefb969ca37.zip |
get_header_ar: reformatted code, no real changes
-rw-r--r-- | archival/libunarchive/get_header_ar.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/archival/libunarchive/get_header_ar.c b/archival/libunarchive/get_header_ar.c index 4e294b2c0..a8a595e08 100644 --- a/archival/libunarchive/get_header_ar.c +++ b/archival/libunarchive/get_header_ar.c | |||
@@ -66,7 +66,9 @@ char get_header_ar(archive_handle_t *archive_handle) | |||
66 | 66 | ||
67 | /* long filenames have '/' as the first character */ | 67 | /* long filenames have '/' as the first character */ |
68 | if (ar.formatted.name[0] == '/') { | 68 | if (ar.formatted.name[0] == '/') { |
69 | #ifdef CONFIG_FEATURE_AR_LONG_FILENAMES | 69 | unsigned long_offset; |
70 | |||
71 | #if ENABLE_FEATURE_AR_LONG_FILENAMES | ||
70 | if (ar.formatted.name[1] == '/') { | 72 | if (ar.formatted.name[1] == '/') { |
71 | /* If the second char is a '/' then this entries data section | 73 | /* If the second char is a '/' then this entries data section |
72 | * stores long filename for multiple entries, they are stored | 74 | * stores long filename for multiple entries, they are stored |
@@ -78,20 +80,22 @@ char get_header_ar(archive_handle_t *archive_handle) | |||
78 | /* This ar entries data section only contained filenames for other records | 80 | /* This ar entries data section only contained filenames for other records |
79 | * they are stored in the static ar_long_names for future reference */ | 81 | * they are stored in the static ar_long_names for future reference */ |
80 | return get_header_ar(archive_handle); /* Return next header */ | 82 | return get_header_ar(archive_handle); /* Return next header */ |
81 | } else if (ar.formatted.name[1] == ' ') { | 83 | } |
84 | |||
85 | if (ar.formatted.name[1] == ' ') { | ||
82 | /* This is the index of symbols in the file for compilers */ | 86 | /* This is the index of symbols in the file for compilers */ |
83 | data_skip(archive_handle); | 87 | data_skip(archive_handle); |
84 | archive_handle->offset += typed->size; | 88 | archive_handle->offset += typed->size; |
85 | return get_header_ar(archive_handle); /* Return next header */ | 89 | return get_header_ar(archive_handle); /* Return next header */ |
86 | } else { | ||
87 | /* The number after the '/' indicates the offset in the ar data section | ||
88 | (saved in variable long_name) that conatains the real filename */ | ||
89 | const unsigned int long_offset = atoi(&ar.formatted.name[1]); | ||
90 | if (long_offset >= ar_long_name_size) { | ||
91 | bb_error_msg_and_die("can't resolve long filename"); | ||
92 | } | ||
93 | typed->name = xstrdup(ar_long_names + long_offset); | ||
94 | } | 90 | } |
91 | |||
92 | /* The number after the '/' indicates the offset in the ar data section | ||
93 | * (saved in variable long_name) that conatains the real filename */ | ||
94 | long_offset = atoi(&ar.formatted.name[1]); | ||
95 | if (long_offset >= ar_long_name_size) { | ||
96 | bb_error_msg_and_die("can't resolve long filename"); | ||
97 | } | ||
98 | typed->name = xstrdup(ar_long_names + long_offset); | ||
95 | #else | 99 | #else |
96 | bb_error_msg_and_die("long filenames not supported"); | 100 | bb_error_msg_and_die("long filenames not supported"); |
97 | #endif | 101 | #endif |