about summary refs log tree commit diff
path: root/iconvdata
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-11-20 23:42:04 +0000
committerUlrich Drepper <drepper@redhat.com>2002-11-20 23:42:04 +0000
commiteb9dc2a22dbce7b03fb8efbdc67724ffd9b7d85d (patch)
tree6fc48c9f4f1c8e0a1d8a2cf975929aba2c858c85 /iconvdata
parent218d76e03413b532f72d47d2695be049d6a2aa64 (diff)
downloadglibc-eb9dc2a22dbce7b03fb8efbdc67724ffd9b7d85d.tar.gz
glibc-eb9dc2a22dbce7b03fb8efbdc67724ffd9b7d85d.tar.xz
glibc-eb9dc2a22dbce7b03fb8efbdc67724ffd9b7d85d.zip
Update.
	* iconv/gconv_simple.c (internal_ucs4le_loop_unaligned): Return
	__GCONV_EMPTY_INPUT only if input is really empty.  Otherwise
	__GCONV_INCOMPLETE_INPUT.
	(ucs4le_internal_loop): Likewise.
	(ucs4le_internal_loop_unaligned): Likewise.
	* iconvdata/unicode.c (PREPARE_LOOP): Likewise.
	* iconvdata/utf-16.c (PREPARE_LOOP): Likewise.
	* iconvdata/utf-32.c (PREPARE_LOOP): Likewise.

	* iconv/loop.c (LOOPFCT): First test for empty input then for full
	output buffer.
Diffstat (limited to 'iconvdata')
-rw-r--r--iconvdata/unicode.c3
-rw-r--r--iconvdata/utf-16.c3
-rw-r--r--iconvdata/utf-32.c3
3 files changed, 6 insertions, 3 deletions
diff --git a/iconvdata/unicode.c b/iconvdata/unicode.c
index c88f75dd85..df452d2a1d 100644
--- a/iconvdata/unicode.c
+++ b/iconvdata/unicode.c
@@ -49,7 +49,8 @@
 	{								      \
 	  /* We have to find out which byte order the file is encoded in.  */ \
 	  if (inptr + 2 > inend)					      \
-	    return __GCONV_EMPTY_INPUT;					      \
+	    return (inptr == inend					      \
+		    ? __GCONV_EMPTY_INPUT : __GCONV_INCOMPLETE_INPUT);	      \
 									      \
 	  if (get16u (inptr) == BOM)					      \
 	    /* Simply ignore the BOM character.  */			      \
diff --git a/iconvdata/utf-16.c b/iconvdata/utf-16.c
index 642340611d..b8165088e1 100644
--- a/iconvdata/utf-16.c
+++ b/iconvdata/utf-16.c
@@ -51,7 +51,8 @@
 	{								      \
 	  /* We have to find out which byte order the file is encoded in.  */ \
 	  if (inptr + 2 > inend)					      \
-	    return __GCONV_EMPTY_INPUT;					      \
+	    return (inptr == inend					      \
+		    ? __GCONV_EMPTY_INPUT : __GCONV_INCOMPLETE_INPUT);	      \
 									      \
 	  if (get16u (inptr) == BOM)					      \
 	    /* Simply ignore the BOM character.  */			      \
diff --git a/iconvdata/utf-32.c b/iconvdata/utf-32.c
index 01f4b881dc..cc02651374 100644
--- a/iconvdata/utf-32.c
+++ b/iconvdata/utf-32.c
@@ -49,7 +49,8 @@
 	{								      \
 	  /* We have to find out which byte order the file is encoded in.  */ \
 	  if (inptr + 4 > inend)					      \
-	    return __GCONV_EMPTY_INPUT;					      \
+	    return (inptr == inend					      \
+		    ? __GCONV_EMPTY_INPUT : __GCONV_INCOMPLETE_INPUT);	      \
 									      \
 	  if (get32u (inptr) == BOM)					      \
 	    /* Simply ignore the BOM character.  */			      \