aboutsummaryrefslogtreecommitdiff
path: root/archival/libunarchive/get_header_ar.c
diff options
context:
space:
mode:
Diffstat (limited to 'archival/libunarchive/get_header_ar.c')
-rw-r--r--archival/libunarchive/get_header_ar.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/archival/libunarchive/get_header_ar.c b/archival/libunarchive/get_header_ar.c
index 48d7a5ad8..4627695e4 100644
--- a/archival/libunarchive/get_header_ar.c
+++ b/archival/libunarchive/get_header_ar.c
@@ -24,7 +24,7 @@ char get_header_ar(archive_handle_t *archive_handle)
24 char mode[8]; 24 char mode[8];
25 char size[10]; 25 char size[10];
26 char magic[2]; 26 char magic[2];
27 } formated; 27 } formatted;
28 } ar; 28 } ar;
29#ifdef CONFIG_FEATURE_AR_LONG_FILENAMES 29#ifdef CONFIG_FEATURE_AR_LONG_FILENAMES
30 static char *ar_long_names; 30 static char *ar_long_names;
@@ -49,20 +49,20 @@ char get_header_ar(archive_handle_t *archive_handle)
49 archive_handle->offset += 60; 49 archive_handle->offset += 60;
50 50
51 /* align the headers based on the header magic */ 51 /* align the headers based on the header magic */
52 if ((ar.formated.magic[0] != '`') || (ar.formated.magic[1] != '\n')) { 52 if ((ar.formatted.magic[0] != '`') || (ar.formatted.magic[1] != '\n')) {
53 bb_error_msg_and_die("Invalid ar header"); 53 bb_error_msg_and_die("Invalid ar header");
54 } 54 }
55 55
56 typed->mode = strtol(ar.formated.mode, NULL, 8); 56 typed->mode = strtol(ar.formatted.mode, NULL, 8);
57 typed->mtime = atoi(ar.formated.date); 57 typed->mtime = atoi(ar.formatted.date);
58 typed->uid = atoi(ar.formated.uid); 58 typed->uid = atoi(ar.formatted.uid);
59 typed->gid = atoi(ar.formated.gid); 59 typed->gid = atoi(ar.formatted.gid);
60 typed->size = atoi(ar.formated.size); 60 typed->size = atoi(ar.formatted.size);
61 61
62 /* long filenames have '/' as the first character */ 62 /* long filenames have '/' as the first character */
63 if (ar.formated.name[0] == '/') { 63 if (ar.formatted.name[0] == '/') {
64#ifdef CONFIG_FEATURE_AR_LONG_FILENAMES 64#ifdef CONFIG_FEATURE_AR_LONG_FILENAMES
65 if (ar.formated.name[1] == '/') { 65 if (ar.formatted.name[1] == '/') {
66 /* If the second char is a '/' then this entries data section 66 /* If the second char is a '/' then this entries data section
67 * stores long filename for multiple entries, they are stored 67 * stores long filename for multiple entries, they are stored
68 * in static variable long_names for use in future entries */ 68 * in static variable long_names for use in future entries */
@@ -73,7 +73,7 @@ char get_header_ar(archive_handle_t *archive_handle)
73 /* This ar entries data section only contained filenames for other records 73 /* This ar entries data section only contained filenames for other records
74 * they are stored in the static ar_long_names for future reference */ 74 * they are stored in the static ar_long_names for future reference */
75 return (get_header_ar(archive_handle)); /* Return next header */ 75 return (get_header_ar(archive_handle)); /* Return next header */
76 } else if (ar.formated.name[1] == ' ') { 76 } else if (ar.formatted.name[1] == ' ') {
77 /* This is the index of symbols in the file for compilers */ 77 /* This is the index of symbols in the file for compilers */
78 data_skip(archive_handle); 78 data_skip(archive_handle);
79 archive_handle->offset += typed->size; 79 archive_handle->offset += typed->size;
@@ -81,7 +81,7 @@ char get_header_ar(archive_handle_t *archive_handle)
81 } else { 81 } else {
82 /* The number after the '/' indicates the offset in the ar data section 82 /* The number after the '/' indicates the offset in the ar data section
83 (saved in variable long_name) that conatains the real filename */ 83 (saved in variable long_name) that conatains the real filename */
84 const unsigned int long_offset = atoi(&ar.formated.name[1]); 84 const unsigned int long_offset = atoi(&ar.formatted.name[1]);
85 if (long_offset >= ar_long_name_size) { 85 if (long_offset >= ar_long_name_size) {
86 bb_error_msg_and_die("Cant resolve long filename"); 86 bb_error_msg_and_die("Cant resolve long filename");
87 } 87 }
@@ -92,7 +92,7 @@ char get_header_ar(archive_handle_t *archive_handle)
92#endif 92#endif
93 } else { 93 } else {
94 /* short filenames */ 94 /* short filenames */
95 typed->name = bb_xstrndup(ar.formated.name, 16); 95 typed->name = bb_xstrndup(ar.formatted.name, 16);
96 } 96 }
97 97
98 typed->name[strcspn(typed->name, " /")] = '\0'; 98 typed->name[strcspn(typed->name, " /")] = '\0';