- complement(input);
- if (argv[index] != NULL)
- expand(argv[index], output);
- if (argv[index] != NULL)
- map(input, output);
- for (ptr = input; *ptr; ptr++)
- invec[*ptr] = TRUE;
- for (ptr = output; *ptr; ptr++)
- outvec[*ptr] = TRUE;
+ input_length = complement(input, input_length);
+ if (argv[idx] != NULL) {
+ if (*argv[idx] == '\0')
+ bb_error_msg_and_die("STRING2 cannot be empty");
+ output_length = expand(argv[idx], output);
+ map(input, input_length, output, output_length);
+ }
+ for (i = 0; i < input_length; i++)
+ invec[(int)input[i]] = TRUE;
+ for (i = 0; i < output_length; i++)
+ outvec[(int)output[i]] = TRUE;