aboutsummaryrefslogtreecommitdiff
path: root/archival/ar.c
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2001-04-12 16:37:13 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2001-04-12 16:37:13 +0000
commit47fd219c956d1963fca0ba73ff7b21b1273977a7 (patch)
treefecf85bd7a0277173ba75afa5c3034991d7ac6fa /archival/ar.c
parentbe66ad3212ed728e0a5fa4b972a904a1aa0c9d51 (diff)
downloadbusybox-w32-47fd219c956d1963fca0ba73ff7b21b1273977a7.tar.gz
busybox-w32-47fd219c956d1963fca0ba73ff7b21b1273977a7.tar.bz2
busybox-w32-47fd219c956d1963fca0ba73ff7b21b1273977a7.zip
Rename variable that shadows global
Diffstat (limited to 'archival/ar.c')
-rw-r--r--archival/ar.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/archival/ar.c b/archival/ar.c
index 8ab386821..4c3d0bbd5 100644
--- a/archival/ar.c
+++ b/archival/ar.c
@@ -39,9 +39,9 @@ extern int ar_main(int argc, char **argv)
39 FILE *src_file = NULL, *dst_file = NULL; 39 FILE *src_file = NULL, *dst_file = NULL;
40 int funct = 0, opt=0; 40 int funct = 0, opt=0;
41 41
42 ar_headers_t *head, *extract_list=NULL; 42 ar_headers_t *head, *ar_extract_list=NULL;
43 43
44 extract_list = (ar_headers_t *) xcalloc(1, sizeof(ar_headers_t)); 44 ar_extract_list = (ar_headers_t *) xcalloc(1, sizeof(ar_headers_t));
45 head = (ar_headers_t *) xcalloc(1, sizeof(ar_headers_t)); 45 head = (ar_headers_t *) xcalloc(1, sizeof(ar_headers_t));
46 46
47 while ((opt = getopt(argc, argv, "ovtpx")) != -1) { 47 while ((opt = getopt(argc, argv, "ovtpx")) != -1) {
@@ -87,9 +87,9 @@ extern int ar_main(int argc, char **argv)
87 if (strcmp(argv[optind], ar_entry->name) == 0) { 87 if (strcmp(argv[optind], ar_entry->name) == 0) {
88 ar_headers_t *tmp; 88 ar_headers_t *tmp;
89 tmp = (ar_headers_t *) xmalloc(sizeof(ar_headers_t)); 89 tmp = (ar_headers_t *) xmalloc(sizeof(ar_headers_t));
90 *tmp = *extract_list; 90 *tmp = *ar_extract_list;
91 *extract_list = *ar_entry; 91 *ar_extract_list = *ar_entry;
92 extract_list->next = tmp; 92 ar_extract_list->next = tmp;
93 break; 93 break;
94 } 94 }
95 ar_entry=ar_entry->next; 95 ar_entry=ar_entry->next;
@@ -97,31 +97,31 @@ extern int ar_main(int argc, char **argv)
97 } 97 }
98 98
99 /* if individual files not found extract all files */ 99 /* if individual files not found extract all files */
100 if (extract_list->next==NULL) { 100 if (ar_extract_list->next==NULL) {
101 extract_list = head; 101 ar_extract_list = head;
102 } 102 }
103 103
104 /* find files to extract or display */ 104 /* find files to extract or display */
105 while (extract_list->next != NULL) { 105 while (ar_extract_list->next != NULL) {
106 if (funct & extract_to_file) { 106 if (funct & extract_to_file) {
107 dst_file = wfopen(extract_list->name, "w"); 107 dst_file = wfopen(ar_extract_list->name, "w");
108 } 108 }
109 else if (funct & extract_to_stdout) { 109 else if (funct & extract_to_stdout) {
110 dst_file = stdout; 110 dst_file = stdout;
111 } 111 }
112 if ((funct & extract_to_file) || (funct & extract_to_stdout)) { 112 if ((funct & extract_to_file) || (funct & extract_to_stdout)) {
113 fseek(src_file, extract_list->offset, SEEK_SET); 113 fseek(src_file, ar_extract_list->offset, SEEK_SET);
114 copy_file_chunk(src_file, dst_file, (off_t) extract_list->size); 114 copy_file_chunk(src_file, dst_file, ar_extract_list->size);
115 } 115 }
116 if (funct & verbose) { 116 if (funct & verbose) {
117 printf("%s %d/%d %8d %s ", mode_string(extract_list->mode), 117 printf("%s %d/%d %8d %s ", mode_string(ar_extract_list->mode),
118 extract_list->uid, extract_list->gid, 118 ar_extract_list->uid, ar_extract_list->gid,
119 (int) extract_list->size, time_string(extract_list->mtime)); 119 (int) ar_extract_list->size, time_string(ar_extract_list->mtime));
120 } 120 }
121 if ((funct & display) || (funct & verbose)){ 121 if ((funct & display) || (funct & verbose)){
122 printf("%s\n", extract_list->name); 122 printf("%s\n", ar_extract_list->name);
123 } 123 }
124 extract_list=extract_list->next; 124 ar_extract_list = ar_extract_list->next;
125 } 125 }
126 return EXIT_SUCCESS; 126 return EXIT_SUCCESS;
127} 127}