about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-01-19 06:06:01 +0000
committerUlrich Drepper <drepper@redhat.com>2000-01-19 06:06:01 +0000
commit1f547466cf31480bba48d480f16b6fc9c4997635 (patch)
tree64eb9c736388e85ba8db828b21a537947bf46004
parent9deb2b365c885d912b7733b828df42668f176f2c (diff)
downloadglibc-1f547466cf31480bba48d480f16b6fc9c4997635.tar.gz
glibc-1f547466cf31480bba48d480f16b6fc9c4997635.tar.xz
glibc-1f547466cf31480bba48d480f16b6fc9c4997635.zip
Update.
	* wcsmbs/mbrtowc.c: Don't set errno if byte sequence is only
	incomplete but correct.

	* locale/programs/charmap.c: NUL-terminate names of generated
-rw-r--r--ChangeLog5
-rw-r--r--wcsmbs/mbrtowc.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 227916c576..b14b44ebf4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
 2000-01-18  Ulrich Drepper  <drepper@cygnus.com>
 
-	* locale/programs/charmap.c: NUL-terminte names of generated
+	* wcsmbs/mbrtowc.c: Don't set errno if byte sequence is only
+	incomplete but correct.
+
+	* locale/programs/charmap.c: NUL-terminate names of generated
 	entries for ellipsis.
 
 2000-01-18  Andreas Jaeger  <aj@suse.de>
diff --git a/wcsmbs/mbrtowc.c b/wcsmbs/mbrtowc.c
index a68b0f2f79..cb0aa32bbc 100644
--- a/wcsmbs/mbrtowc.c
+++ b/wcsmbs/mbrtowc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gnu.org>, 1996.
 
@@ -90,9 +90,11 @@ __mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
       else
 	result = inbuf - (const unsigned char *) s;
     }
+  else if (status == __GCONV_INCOMPLETE_INPUT)
+    result = (size_t) -2;
   else
     {
-      result = status == __GCONV_INCOMPLETE_INPUT ? (size_t) -2 : (size_t) -1;
+      result = (size_t) -1;
       __set_errno (EILSEQ);
     }