diff options
| author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-03-23 17:08:21 +0000 |
|---|---|---|
| committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-03-23 17:08:21 +0000 |
| commit | 8538d82a9e226b26b2bb0fa973550007c234bc55 (patch) | |
| tree | f4c9ca939b621dfd1efcd227f0fe83813fa088a9 /coreutils | |
| parent | f7ab43234f715aed0d28efb021c0220115529b5a (diff) | |
| download | busybox-w32-8538d82a9e226b26b2bb0fa973550007c234bc55.tar.gz busybox-w32-8538d82a9e226b26b2bb0fa973550007c234bc55.tar.bz2 busybox-w32-8538d82a9e226b26b2bb0fa973550007c234bc55.zip | |
-Wshadow tr fix from Jeff Garzik
git-svn-id: svn://busybox.net/trunk/busybox@2191 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'coreutils')
| -rw-r--r-- | coreutils/tr.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/coreutils/tr.c b/coreutils/tr.c index ddb73873d..32a4f2917 100644 --- a/coreutils/tr.c +++ b/coreutils/tr.c | |||
| @@ -142,7 +142,7 @@ extern int tr_main(int argc, char **argv) | |||
| 142 | { | 142 | { |
| 143 | register unsigned char *ptr; | 143 | register unsigned char *ptr; |
| 144 | int output_length=0, input_length; | 144 | int output_length=0, input_length; |
| 145 | int index = 1; | 145 | int idx = 1; |
| 146 | int i; | 146 | int i; |
| 147 | RESERVE_BB_BUFFER(output, BUFSIZ); | 147 | RESERVE_BB_BUFFER(output, BUFSIZ); |
| 148 | RESERVE_BB_BUFFER(input, BUFSIZ); | 148 | RESERVE_BB_BUFFER(input, BUFSIZ); |
| @@ -157,8 +157,8 @@ extern int tr_main(int argc, char **argv) | |||
| 157 | pinvec = invec; | 157 | pinvec = invec; |
| 158 | poutvec = outvec; | 158 | poutvec = outvec; |
| 159 | 159 | ||
| 160 | if (argc > 1 && argv[index][0] == '-') { | 160 | if (argc > 1 && argv[idx][0] == '-') { |
| 161 | for (ptr = (unsigned char *) &argv[index][1]; *ptr; ptr++) { | 161 | for (ptr = (unsigned char *) &argv[idx][1]; *ptr; ptr++) { |
| 162 | switch (*ptr) { | 162 | switch (*ptr) { |
| 163 | case 'c': | 163 | case 'c': |
| 164 | com_fl = TRUE; | 164 | com_fl = TRUE; |
| @@ -173,21 +173,21 @@ extern int tr_main(int argc, char **argv) | |||
| 173 | show_usage(); | 173 | show_usage(); |
| 174 | } | 174 | } |
| 175 | } | 175 | } |
| 176 | index++; | 176 | idx++; |
| 177 | } | 177 | } |
| 178 | for (i = 0; i <= ASCII; i++) { | 178 | for (i = 0; i <= ASCII; i++) { |
| 179 | vector[i] = i; | 179 | vector[i] = i; |
| 180 | invec[i] = outvec[i] = FALSE; | 180 | invec[i] = outvec[i] = FALSE; |
| 181 | } | 181 | } |
| 182 | 182 | ||
| 183 | if (argv[index] != NULL) { | 183 | if (argv[idx] != NULL) { |
| 184 | input_length = expand(argv[index++], input); | 184 | input_length = expand(argv[idx++], input); |
| 185 | if (com_fl) | 185 | if (com_fl) |
| 186 | input_length = complement(input, input_length); | 186 | input_length = complement(input, input_length); |
| 187 | if (argv[index] != NULL) { | 187 | if (argv[idx] != NULL) { |
| 188 | if (*argv[index] == '\0') | 188 | if (*argv[idx] == '\0') |
| 189 | error_msg_and_die("STRING2 cannot be empty"); | 189 | error_msg_and_die("STRING2 cannot be empty"); |
| 190 | output_length = expand(argv[index], output); | 190 | output_length = expand(argv[idx], output); |
| 191 | map(input, input_length, output, output_length); | 191 | map(input, input_length, output, output_length); |
| 192 | } | 192 | } |
| 193 | for (i = 0; i < input_length; i++) | 193 | for (i = 0; i < input_length; i++) |
