aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-06-27 20:27:32 +0000
committerUlrich Drepper <drepper@redhat.com>2000-06-27 20:27:32 +0000
commit37696206076f6f075542adfdc4b1fe49100e9f32 (patch)
treeb58303745f49a52aa76c8b6ccf178fcbbb6e12ac
parent1539660873718894bb0cfbdff443d3691c32b826 (diff)
downloadglibc-37696206076f6f075542adfdc4b1fe49100e9f32.zip
glibc-37696206076f6f075542adfdc4b1fe49100e9f32.tar.gz
glibc-37696206076f6f075542adfdc4b1fe49100e9f32.tar.bz2
Update.
2000-06-27 Ulrich Drepper <drepper@redhat.com> * wctype/towctrans.c (__towctrans): Be graceful and accept error return values from the wctrans function.
-rw-r--r--ChangeLog5
-rw-r--r--wctype/towctrans.c7
2 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f4e332d..e53b21d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-06-27 Ulrich Drepper <drepper@redhat.com>
+
+ * wctype/towctrans.c (__towctrans): Be graceful and accept error
+ return values from the wctrans function.
+
2000-06-27 Greg McGary <greg@mcgary.org>
* elf/dl-open.c (_dl_sysdep_start): Wrap weak_extern decl in BP_SYM ().
diff --git a/wctype/towctrans.c b/wctype/towctrans.c
index b0180fd..425fd52 100644
--- a/wctype/towctrans.c
+++ b/wctype/towctrans.c
@@ -1,5 +1,5 @@
/* Map wide character using given mapping.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,6 +27,11 @@ __towctrans (wint_t wc, wctrans_t desc)
{
size_t idx;
+ /* If the user passes in an invalid DESC valid (the one returned from
+ `wctrans' in case of an error) simply return the value. */
+ if (desc == (wctrans_t) 0)
+ return wc;
+
idx = cname_lookup (wc);
if (idx == ~((size_t) 0))
/* Character is not known. Default action is to simply return it. */