tr: an escaped dash doesn't indicate a range
No binary (build failed)
—
(log yok)
| @@ -117,6 +117,11 @@ static unsigned expand(char *arg, char **buffer_p) | |
| arg++; | |
| z = arg; | |
| ac = bb_process_escape_sequence(&z); | |
| + | if (ac == '\\' && *z == '-') { |
| + | /* An escaped dash isn't a range, don't fall through */ |
| + | buffer[pos++] = *z; |
| + | continue; |
| + | } |
| arg = (char *)z; | |
| arg--; | |
| *arg = ac; | |
| @@ -15,6 +15,10 @@ testing "tr understands 0-9A-F" \ | |
| "tr -cd '[0-9A-F]'" \ | |
| "19AF" "" "19AFH\n" | |
| + | testing "tr does not treat [p\\-r] as a range" \ |
| + | "tr '[p\\-r]' '+'" \ |
| + | "o+q+s+\n" "" "opqrs-\n" |
| + | |
| optional FEATURE_TR_CLASSES | |
| testing "tr understands [:xdigit:]" \ | |
| "tr -cd '[:xdigit:]'" \ | |