diff options
author | ache <ache@FreeBSD.org> | 1995-10-28 22:27:03 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1995-10-28 22:27:03 +0000 |
commit | 7c029396706eb50c2b89da2d48ef12ec42fc1c15 (patch) | |
tree | 41c23785c52ec73e6f52c0eb434c8c41d2cabd2b /usr.bin/tr/str.c | |
parent | 822bceb624e3740412b90941feb1158d82f50edc (diff) | |
download | FreeBSD-src-7c029396706eb50c2b89da2d48ef12ec42fc1c15.zip FreeBSD-src-7c029396706eb50c2b89da2d48ef12ec42fc1c15.tar.gz |
Fix broken charclass handling
Add setlocale LC_CTYPE
Diffstat (limited to 'usr.bin/tr/str.c')
-rw-r--r-- | usr.bin/tr/str.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/usr.bin/tr/str.c b/usr.bin/tr/str.c index 63ba44a..9675e0f 100644 --- a/usr.bin/tr/str.c +++ b/usr.bin/tr/str.c @@ -151,17 +151,29 @@ typedef struct { } CLASS; static CLASS classes[] = { +#undef isalnum { "alnum", isalnum, }, +#undef isalpha { "alpha", isalpha, }, +#undef isblank { "blank", isblank, }, +#undef iscntrl { "cntrl", iscntrl, }, +#undef isdigit { "digit", isdigit, }, +#undef isgraph { "graph", isgraph, }, +#undef islower { "lower", islower, }, +#undef isprint { "print", isprint, }, +#undef ispunct { "punct", ispunct, }, +#undef isspace { "space", isspace, }, +#undef isupper { "upper", isupper, }, +#undef isxdigit { "xdigit", isxdigit, }, }; @@ -279,9 +291,6 @@ genseq(s) s->state = s->cnt ? SEQUENCE : INFINITE; } -/* Use the #defines isXXX() here, DON'T use them above. */ -#include <ctype.h> - /* * Translate \??? into a character. Up to 3 octal digits, if no digits either * an escape code or a literal character. |