Don't return error for invald error if ignore flag is set.
[kopensolaris-gnu/glibc.git] / iconvdata / iso8859-1.c
index 06eeda5..4949991 100644 (file)
@@ -1,5 +1,5 @@
 /* Conversion to and from ISO 8859-1.
-   Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
     if (ch > 0xff)                                                           \
       {                                                                              \
        /* We have an illegal character.  */                                  \
-       result = __GCONV_ILLEGAL_INPUT;                                       \
-       break;                                                                \
+       if (! ignore_errors_p ())                                             \
+         {                                                                   \
+           result = __GCONV_ILLEGAL_INPUT;                                   \
+           break;                                                            \
+         }                                                                   \
+                                                                             \
+       ++*converted;                                                         \
       }                                                                              \
-    *outptr++ = (unsigned char) ch;                                          \
+    else                                                                     \
+      *outptr++ = (unsigned char) ch;                                        \
     inptr += 4;                                                                      \
   }
 #include <iconv/loop.c>