(read_process_output): Handle carryover correctly.
authorKenichi Handa <handa@m17n.org>
Thu, 5 Jun 2003 07:17:10 +0000 (07:17 +0000)
committerKenichi Handa <handa@m17n.org>
Thu, 5 Jun 2003 07:17:10 +0000 (07:17 +0000)
src/ChangeLog
src/process.c

index 3cd24ef..4c07d29 100644 (file)
@@ -1,8 +1,12 @@
+2003-06-05  Kenichi Handa  <handa@m17n.org>
+
+       * process.c (read_process_output): Handle carryover correctly.
+
 2003-06-02  Dave Love  <fx@gnu.org>
 
        * regex.c (re_search_2): Fix last change.
 
-2003-05-30  Kenichi Handa  <handa@etlken2>
+2003-05-30  Kenichi Handa  <handa@m17n.org>
 
        * regex.c (GET_CHAR_BEFORE_2): Check multibyte, not
        target_multibyte.  Even in a unibyte case, return a converted
index 5ca96d8..618e7b5 100644 (file)
@@ -3050,10 +3050,12 @@ read_process_output (proc, channel)
            }
        }
 
-      carryover = nbytes - coding->consumed;
-      bcopy (chars + coding->consumed, XSTRING (p->decoding_buf)->data,
-            carryover);
-      XSETINT (p->decoding_carryover, carryover);
+      if (coding->carryover_bytes > 0)
+       {
+         bcopy (coding->carryover, XSTRING (p->decoding_buf)->data,
+                coding->carryover_bytes);
+         XSETINT (p->decoding_carryover, coding->carryover_bytes);
+       }
       nbytes = STRING_BYTES (XSTRING (text));
       nchars = XSTRING (text)->size;
       if (nbytes > 0)
@@ -3151,10 +3153,12 @@ read_process_output (proc, channel)
                                   proc_encode_coding_system[XINT (p->outfd)]);
            }
        }
-      carryover = nbytes - coding->consumed;
-      bcopy (chars + coding->consumed, XSTRING (p->decoding_buf)->data,
-            carryover);
-      XSETINT (p->decoding_carryover, carryover);
+      if (coding->carryover_bytes > 0)
+       {
+         bcopy (coding->carryover, XSTRING (p->decoding_buf)->data,
+                coding->carryover_bytes);
+         XSETINT (p->decoding_carryover, coding->carryover_bytes);
+       }
       /* Adjust the multibyteness of TEXT to that of the buffer.  */
       if (NILP (current_buffer->enable_multibyte_characters)
          != ! STRING_MULTIBYTE (text))