diff src/fileio.c @ 177:84c21eb4fc40

updated for version 7.0054
author vimboss
date Mon, 28 Feb 2005 22:44:58 +0000
parents 8c60f65311fa
children 7fd70926e2e1
line wrap: on
line diff
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -1333,10 +1333,19 @@ retry:
 		 * If there is conversion error or not enough room try using
 		 * another conversion.
 		 */
-		if ((iconv(iconv_fd, (void *)&fromp, &from_size, &top, &to_size)
+		while ((iconv(iconv_fd, (void *)&fromp, &from_size,
+							       &top, &to_size)
 			    == (size_t)-1 && ICONV_ERRNO != ICONV_EINVAL)
 						  || from_size > CONV_RESTLEN)
-		    goto rewind_retry;
+		{
+		    if (!keep_dest_enc)
+			goto rewind_retry;
+		    /* Ignore a byte and try again. */
+		    ++fromp;
+		    --from_size;
+		    *top++ = '?';
+		    --to_size;
+		}
 
 		if (from_size > 0)
 		{