diff options
author | ache <ache@FreeBSD.org> | 1996-03-25 13:43:24 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1996-03-25 13:43:24 +0000 |
commit | 5ae177135b1537604602319633c7e12b6af6a22a (patch) | |
tree | a90e68317ec5f4183a35334355850ada3393d92e /lib | |
parent | 5719077b9bc1f88fe7168bb6f209aa816b980b9c (diff) | |
download | FreeBSD-src-5ae177135b1537604602319633c7e12b6af6a22a.zip FreeBSD-src-5ae177135b1537604602319633c7e12b6af6a22a.tar.gz |
Remove half-dancing solution for signed chars to help finding
POSIXly-incorrect programs.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/locale/tolower.c | 13 | ||||
-rw-r--r-- | lib/libc/locale/toupper.c | 13 |
2 files changed, 6 insertions, 20 deletions
diff --git a/lib/libc/locale/tolower.c b/lib/libc/locale/tolower.c index e72a52c..f8d1623 100644 --- a/lib/libc/locale/tolower.c +++ b/lib/libc/locale/tolower.c @@ -45,17 +45,10 @@ ___tolower(c) int x; _RuneRange *rr = &_CurrentRuneLocale->maplower_ext; _RuneEntry *re = rr->ranges; -#endif - if (c == EOF) - return(EOF); - if (c < 0) { - if (c >= -128) /* signed char */ - return(_CurrentRuneLocale->maplower[(unsigned char)c]); - else - return(c); - } -#ifdef XPG4 + if (c < 0 || c == EOF) + return(c); + for (x = 0; x < rr->nranges; ++x, ++re) { if (c < re->min) return(c); diff --git a/lib/libc/locale/toupper.c b/lib/libc/locale/toupper.c index 08be64b..9e60977 100644 --- a/lib/libc/locale/toupper.c +++ b/lib/libc/locale/toupper.c @@ -45,17 +45,10 @@ ___toupper(c) int x; _RuneRange *rr = &_CurrentRuneLocale->mapupper_ext; _RuneEntry *re = rr->ranges; -#endif - if (c == EOF) - return(EOF); - if (c < 0) { - if (c >= -128) /* signed char */ - return(_CurrentRuneLocale->mapupper[(unsigned char)c]); - else - return(c); - } -#ifdef XPG4 + if (c < 0 || c == EOF) + return(c); + for (x = 0; x < rr->nranges; ++x, ++re) { if (c < re->min) return(c); |