aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>1994-10-08 17:42:45 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>1994-10-08 17:42:45 +0000
commit4c02aebe2fc3445fcfb8b13e0c06dd45e545cf5b (patch)
treec23ec9c141e634f927d4421c51a840aaa9b4dbae
parent262fb20771714b3917788858a5a7dcd082d254a9 (diff)
Notes
-rw-r--r--lib/libc/locale/nomacros.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/libc/locale/nomacros.c b/lib/libc/locale/nomacros.c
index 32ee404595902..90d1fe9cd9950 100644
--- a/lib/libc/locale/nomacros.c
+++ b/lib/libc/locale/nomacros.c
@@ -1,3 +1,4 @@
+#include <stdio.h>
#include <ctype.h>
#include <rune.h>
@@ -10,6 +11,10 @@ __istype(c, f)
_BSD_RUNE_T_ c;
unsigned long f;
{
+ if (c == EOF)
+ return 0;
+ if (c < 0)
+ c = (unsigned char) c;
return ((((c & _CRMASK) ? ___runetype(c)
: _CurrentRuneLocale->runetype[c]) & f) ? 1 : 0);
}
@@ -19,6 +24,10 @@ __isctype(_BSD_RUNE_T_ c, unsigned long f)
_BSD_RUNE_T_ c;
unsigned long f;
{
+ if (c == EOF)
+ return 0;
+ if (c < 0)
+ c = (unsigned char) c;
return ((((c & _CRMASK) ? 0
: _DefaultRuneLocale.runetype[c]) & f) ? 1 : 0);
}
@@ -27,6 +36,10 @@ _BSD_RUNE_T_
toupper(c)
_BSD_RUNE_T_ c;
{
+ if (c == EOF)
+ return EOF;
+ if (c < 0)
+ c = (unsigned char) c;
return ((c & _CRMASK) ?
___toupper(c) : _CurrentRuneLocale->mapupper[c]);
}
@@ -35,6 +48,10 @@ _BSD_RUNE_T_
tolower(c)
_BSD_RUNE_T_ c;
{
+ if (c == EOF)
+ return EOF;
+ if (c < 0)
+ c = (unsigned char) c;
return ((c & _CRMASK) ?
___tolower(c) : _CurrentRuneLocale->maplower[c]);
}