(PREPARE_LOOP): Return __GCONV_EMPTY_INPUT only if input is really
authordrepper <drepper>
Wed, 20 Nov 2002 23:40:45 +0000 (23:40 +0000)
committerdrepper <drepper>
Wed, 20 Nov 2002 23:40:45 +0000 (23:40 +0000)
empty.  Otherwise __GCONV_INCOMPLETE_INPUT.

iconvdata/unicode.c
iconvdata/utf-16.c
iconvdata/utf-32.c

index c88f75d..df452d2 100644 (file)
@@ -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.  */                           \
index 6423406..b816508 100644 (file)
@@ -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.  */                           \
index 01f4b88..cc02651 100644 (file)
@@ -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.  */                           \