Add trivial equivalence class support in tr(1) and update manpage
Equivalence classes are a hard matter and there's still no "standard" way to solve the issue. Previously, tr would just skip those classes, but it's much better when it resolves a [=c=] to a normal c instead of treating it as a literal. Also, reflect recent changes in the manpage (octal escapes) and fix the markup in some areas.
This commit is contained in:
6
tr.c
6
tr.c
@@ -143,6 +143,12 @@ nextbrack:
|
||||
|
||||
/* CLASSES [=EQUIV=] (skip) */
|
||||
if (j - i > 3 && rstr[i + 1] == '=' && rstr[m - 1] == '=') {
|
||||
if (j - i != 4)
|
||||
goto literal;
|
||||
(*set)[setranges].start = rstr[i + 2];
|
||||
(*set)[setranges].end = rstr[i + 2];
|
||||
(*set)[setranges].quant = 1;
|
||||
setranges++;
|
||||
i = j;
|
||||
continue;
|
||||
}
|
||||
|
Reference in New Issue
Block a user