texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[6896] extra iconv flush


From: Gavin D. Smith
Subject: [6896] extra iconv flush
Date: Sat, 26 Dec 2015 10:11:09 +0000

Revision: 6896
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6896
Author:   gavin
Date:     2015-12-26 10:11:07 +0000 (Sat, 26 Dec 2015)
Log Message:
-----------
extra iconv flush

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/info-utils.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2015-12-26 10:07:29 UTC (rev 6895)
+++ trunk/ChangeLog     2015-12-26 10:11:07 UTC (rev 6896)
@@ -1,3 +1,12 @@
+2015-12-26  Gavin Smith  <address@hidden>
+
+       * info/info-utils.c (copy_converting): When using ASCII 
+       downgrade for unknown sequences, call 'iconv' with 2nd and 3rd 
+       arguments null to flush any converted character before using 
+       another iconv conversion state on the input.  Reorder switch
+       statement to put the only case that falls through to the end 
+       last.
+
 2015-12-25  Eli Zaretskii  <address@hidden>
 
        * info/pcterm.c (blinkvideo, textcolor, textbackground) [_WIN32]:

Modified: trunk/info/info-utils.c
===================================================================
--- trunk/info/info-utils.c     2015-12-26 10:07:29 UTC (rev 6895)
+++ trunk/info/info-utils.c     2015-12-26 10:11:07 UTC (rev 6896)
@@ -870,9 +870,6 @@
              and try again. */
           text_buffer_alloc (&output_buf, n);
           continue;
-        case EILSEQ:
-          /* Byte sequence in input buffer not recognized. */
-          break;
         case EINVAL:
           /* Incomplete byte sequence at end of input buffer.  Try to read
              more. */
@@ -891,16 +888,21 @@
               bytes_left = 0;
             }
           continue;
-        default: /* Unknown error - abort */
+        default: /* Unknown error */
           info_error (_("Error converting file character encoding."));
 
           /* Skip past current input and hope we don't get an
              error next time. */
           inptr += bytes_left;
           return 0;
+        case EILSEQ:
+          /* Byte sequence in input not recognized.  Degrade to ASCII.  */
+          break;
         }
 
-      /* Degrade to ASCII. */
+      /* Flush any waiting input in iconv_to_output and enter the
+         default shift state. */
+      text_buffer_iconv (&output_buf, iconv_to_output, NULL, NULL);
       
       if (file_is_in_utf8)
         {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]