diff options
author | Glenn L McGrath <bug1@ihug.co.nz> | 2001-04-12 16:37:13 +0000 |
---|---|---|
committer | Glenn L McGrath <bug1@ihug.co.nz> | 2001-04-12 16:37:13 +0000 |
commit | 47fd219c956d1963fca0ba73ff7b21b1273977a7 (patch) | |
tree | fecf85bd7a0277173ba75afa5c3034991d7ac6fa | |
parent | be66ad3212ed728e0a5fa4b972a904a1aa0c9d51 (diff) | |
download | busybox-47fd219c956d1963fca0ba73ff7b21b1273977a7.tar.gz |
Rename variable that shadows global
-rw-r--r-- | ar.c | 32 | ||||
-rw-r--r-- | archival/ar.c | 32 |
2 files changed, 32 insertions, 32 deletions
@@ -39,9 +39,9 @@ extern int ar_main(int argc, char **argv) FILE *src_file = NULL, *dst_file = NULL; int funct = 0, opt=0; - ar_headers_t *head, *extract_list=NULL; + ar_headers_t *head, *ar_extract_list=NULL; - extract_list = (ar_headers_t *) xcalloc(1, sizeof(ar_headers_t)); + ar_extract_list = (ar_headers_t *) xcalloc(1, sizeof(ar_headers_t)); head = (ar_headers_t *) xcalloc(1, sizeof(ar_headers_t)); while ((opt = getopt(argc, argv, "ovtpx")) != -1) { @@ -87,9 +87,9 @@ extern int ar_main(int argc, char **argv) if (strcmp(argv[optind], ar_entry->name) == 0) { ar_headers_t *tmp; tmp = (ar_headers_t *) xmalloc(sizeof(ar_headers_t)); - *tmp = *extract_list; - *extract_list = *ar_entry; - extract_list->next = tmp; + *tmp = *ar_extract_list; + *ar_extract_list = *ar_entry; + ar_extract_list->next = tmp; break; } ar_entry=ar_entry->next; @@ -97,31 +97,31 @@ extern int ar_main(int argc, char **argv) } /* if individual files not found extract all files */ - if (extract_list->next==NULL) { - extract_list = head; + if (ar_extract_list->next==NULL) { + ar_extract_list = head; } /* find files to extract or display */ - while (extract_list->next != NULL) { + while (ar_extract_list->next != NULL) { if (funct & extract_to_file) { - dst_file = wfopen(extract_list->name, "w"); + dst_file = wfopen(ar_extract_list->name, "w"); } else if (funct & extract_to_stdout) { dst_file = stdout; } if ((funct & extract_to_file) || (funct & extract_to_stdout)) { - fseek(src_file, extract_list->offset, SEEK_SET); - copy_file_chunk(src_file, dst_file, (off_t) extract_list->size); + fseek(src_file, ar_extract_list->offset, SEEK_SET); + copy_file_chunk(src_file, dst_file, ar_extract_list->size); } if (funct & verbose) { - printf("%s %d/%d %8d %s ", mode_string(extract_list->mode), - extract_list->uid, extract_list->gid, - (int) extract_list->size, time_string(extract_list->mtime)); + printf("%s %d/%d %8d %s ", mode_string(ar_extract_list->mode), + ar_extract_list->uid, ar_extract_list->gid, + (int) ar_extract_list->size, time_string(ar_extract_list->mtime)); } if ((funct & display) || (funct & verbose)){ - printf("%s\n", extract_list->name); + printf("%s\n", ar_extract_list->name); } - extract_list=extract_list->next; + ar_extract_list = ar_extract_list->next; } return EXIT_SUCCESS; } 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) FILE *src_file = NULL, *dst_file = NULL; int funct = 0, opt=0; - ar_headers_t *head, *extract_list=NULL; + ar_headers_t *head, *ar_extract_list=NULL; - extract_list = (ar_headers_t *) xcalloc(1, sizeof(ar_headers_t)); + ar_extract_list = (ar_headers_t *) xcalloc(1, sizeof(ar_headers_t)); head = (ar_headers_t *) xcalloc(1, sizeof(ar_headers_t)); while ((opt = getopt(argc, argv, "ovtpx")) != -1) { @@ -87,9 +87,9 @@ extern int ar_main(int argc, char **argv) if (strcmp(argv[optind], ar_entry->name) == 0) { ar_headers_t *tmp; tmp = (ar_headers_t *) xmalloc(sizeof(ar_headers_t)); - *tmp = *extract_list; - *extract_list = *ar_entry; - extract_list->next = tmp; + *tmp = *ar_extract_list; + *ar_extract_list = *ar_entry; + ar_extract_list->next = tmp; break; } ar_entry=ar_entry->next; @@ -97,31 +97,31 @@ extern int ar_main(int argc, char **argv) } /* if individual files not found extract all files */ - if (extract_list->next==NULL) { - extract_list = head; + if (ar_extract_list->next==NULL) { + ar_extract_list = head; } /* find files to extract or display */ - while (extract_list->next != NULL) { + while (ar_extract_list->next != NULL) { if (funct & extract_to_file) { - dst_file = wfopen(extract_list->name, "w"); + dst_file = wfopen(ar_extract_list->name, "w"); } else if (funct & extract_to_stdout) { dst_file = stdout; } if ((funct & extract_to_file) || (funct & extract_to_stdout)) { - fseek(src_file, extract_list->offset, SEEK_SET); - copy_file_chunk(src_file, dst_file, (off_t) extract_list->size); + fseek(src_file, ar_extract_list->offset, SEEK_SET); + copy_file_chunk(src_file, dst_file, ar_extract_list->size); } if (funct & verbose) { - printf("%s %d/%d %8d %s ", mode_string(extract_list->mode), - extract_list->uid, extract_list->gid, - (int) extract_list->size, time_string(extract_list->mtime)); + printf("%s %d/%d %8d %s ", mode_string(ar_extract_list->mode), + ar_extract_list->uid, ar_extract_list->gid, + (int) ar_extract_list->size, time_string(ar_extract_list->mtime)); } if ((funct & display) || (funct & verbose)){ - printf("%s\n", extract_list->name); + printf("%s\n", ar_extract_list->name); } - extract_list=extract_list->next; + ar_extract_list = ar_extract_list->next; } return EXIT_SUCCESS; } |