summaryrefslogtreecommitdiff
path: root/wcsmbs/btowc.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-04-01 15:13:31 +0000
committerJakub Jelinek <jakub@redhat.com>2005-04-01 15:13:31 +0000
commite8eaba2b25948c0e60f70c33c5c52aad70bbf5fc (patch)
tree020566c0ffd2d27131ee7bac45eea5560a4732bd /wcsmbs/btowc.c
parente3166b6660ce5f0640242a4806a380bb651a2291 (diff)
Updated to fedora-glibc-20050401T1444
Diffstat (limited to 'wcsmbs/btowc.c')
-rw-r--r--wcsmbs/btowc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/wcsmbs/btowc.c b/wcsmbs/btowc.c
index 1ba0221403..6add7ed8bb 100644
--- a/wcsmbs/btowc.c
+++ b/wcsmbs/btowc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996,1997,1998,1999,2000,2002 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2000,2002,2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.org>, 1996.
@@ -17,6 +17,7 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#include <ctype.h>
#include <dlfcn.h>
#include <gconv.h>
#include <stdio.h>
@@ -37,6 +38,11 @@ __btowc (c)
if (c < SCHAR_MIN || c > UCHAR_MAX || c == EOF)
return WEOF;
+ /* We know that only ASCII compatible encodings are used for the
+ locale and that the wide character encoding is ISO 10646. */
+ if (isascii (c))
+ return (wint_t) c;
+
/* Get the conversion functions. */
fcts = get_gconv_fcts (_NL_CURRENT_DATA (LC_CTYPE));