diff options
Diffstat (limited to 'tr.c')
-rw-r--r-- | tr.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -187,10 +187,12 @@ extern int tr_main(int argc, char **argv) | |||
187 | expand(argv[index++], input); | 187 | expand(argv[index++], input); |
188 | if (com_fl) | 188 | if (com_fl) |
189 | complement(input); | 189 | complement(input); |
190 | if (argv[index] != NULL) | 190 | if (argv[index] != NULL) { |
191 | if (*argv[index] == '\0') | ||
192 | fatalError("tr: STRING2 cannot be empty\n"); | ||
191 | expand(argv[index], output); | 193 | expand(argv[index], output); |
192 | if (argv[index] != NULL) | ||
193 | map(input, output); | 194 | map(input, output); |
195 | } | ||
194 | for (ptr = input; *ptr; ptr++) | 196 | for (ptr = input; *ptr; ptr++) |
195 | invec[*ptr] = TRUE; | 197 | invec[*ptr] = TRUE; |
196 | for (ptr = output; *ptr; ptr++) | 198 | for (ptr = output; *ptr; ptr++) |