mirror of git://git.suckless.org/sbase
tr: fix behavior of cflag when using character classes
a simple test case: printf ab3 | tr -c '[:alpha:]' '\n' output should be ab<newline>, previously you would find just newlines. Signed-off-by: noneofyourbusiness <noneofyourbusiness@danwin1210.de>
This commit is contained in:
parent
0b4c2ceb2f
commit
f14887c765
10
tr.c
10
tr.c
|
@ -250,12 +250,10 @@ read:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (set1check && set1check(r)) {
|
if (set1check && set1check(r)) {
|
||||||
if (dflag) {
|
if (cflag)
|
||||||
if (cflag)
|
goto write;
|
||||||
goto write;
|
if (dflag)
|
||||||
else
|
goto read;
|
||||||
goto read;
|
|
||||||
}
|
|
||||||
if (set2check) {
|
if (set2check) {
|
||||||
if (set2check == islowerrune)
|
if (set2check == islowerrune)
|
||||||
r = tolowerrune(r);
|
r = tolowerrune(r);
|
||||||
|
|
Loading…
Reference in New Issue