summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>1996-03-25 13:43:24 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>1996-03-25 13:43:24 +0000
commit7871e368657acf90a78288826f9735abb177ce7c (patch)
treea90e68317ec5f4183a35334355850ada3393d92e /lib/libc
parentbf939705965a09fcb0e8c40de9b8d77a3f6cb19c (diff)
Notes
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/locale/tolower.c13
-rw-r--r--lib/libc/locale/toupper.c13
2 files changed, 6 insertions, 20 deletions
diff --git a/lib/libc/locale/tolower.c b/lib/libc/locale/tolower.c
index e72a52c9e0de..f8d16233e47c 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 08be64b5edfc..9e609774b81a 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);