diff options
author | ache <ache@FreeBSD.org> | 2003-08-03 02:23:39 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2003-08-03 02:23:39 +0000 |
commit | 0113a19ead9ecc4c8d3e911e1dd52f2474e068b0 (patch) | |
tree | 1f11173c6522259931f70066719199160a7dafe8 /usr.bin/tr/extern.h | |
parent | ff880b993e6ccf0433a67419c42064845d6f008a (diff) | |
download | FreeBSD-src-0113a19ead9ecc4c8d3e911e1dd52f2474e068b0.zip FreeBSD-src-0113a19ead9ecc4c8d3e911e1dd52f2474e068b0.tar.gz |
This patch address two problems.
1st one is relatively minor: according our own manpage, upper and lower
classes must be sorted, but currently not.
2nd one is serious:
tr '[:lower:]' '[:upper:]'
(and vice versa) currently works only if upper and lower classes
have exact the same number of elements. When it is not true, like for
many ISO8859-x locales which have bigger amount of lowercase letters,
tr may do nasty things.
See this page
http://www.opengroup.org/onlinepubs/007908799/xcu/tr.html
for detailed description of desired tr behaviour in such cases.
Diffstat (limited to 'usr.bin/tr/extern.h')
-rw-r--r-- | usr.bin/tr/extern.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/tr/extern.h b/usr.bin/tr/extern.h index 356f025..a5ed577 100644 --- a/usr.bin/tr/extern.h +++ b/usr.bin/tr/extern.h @@ -40,7 +40,8 @@ typedef struct { enum { STRING1, STRING2 } which; - enum { EOS, INFINITE, NORMAL, RANGE, SEQUENCE, SET } state; + enum { EOS, INFINITE, NORMAL, RANGE, SEQUENCE, + SET, SET_UPPER, SET_LOWER } state; int cnt; /* character count */ int lastch; /* last character */ int equiv[NCHARS]; /* equivalence set */ @@ -49,3 +50,5 @@ typedef struct { } STR; int next(STR *); +int charcoll(const void *, const void *); + |