aboutsummaryrefslogtreecommitdiff
path: root/coreutils/tr.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-03-23 17:08:21 +0000
committerEric Andersen <andersen@codepoet.org>2001-03-23 17:08:21 +0000
commitf6aa13d403085b1645b65caae4517a338f4636e6 (patch)
treef4c9ca939b621dfd1efcd227f0fe83813fa088a9 /coreutils/tr.c
parent82ab8da24595fced332faf947cc63497216b09db (diff)
downloadbusybox-w32-f6aa13d403085b1645b65caae4517a338f4636e6.tar.gz
busybox-w32-f6aa13d403085b1645b65caae4517a338f4636e6.tar.bz2
busybox-w32-f6aa13d403085b1645b65caae4517a338f4636e6.zip
-Wshadow tr fix from Jeff Garzik
Diffstat (limited to 'coreutils/tr.c')
-rw-r--r--coreutils/tr.c18
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++)