changeset 22502:627b13315f04

(encode_eol): Fix typo that prevented converting to Mac line endings. Always update dst_bytes to number of bytes actually copied. (decode_eol): Fix value of coding->produced when decoding Unix line endings (in case this function is ever used for that).
author Richard M. Stallman <rms@gnu.org>
date Tue, 16 Jun 1998 04:50:57 +0000
parents d2edb98d0fa5
children 104e277d77d3
files src/coding.c
diffstat 1 files changed, 5 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/coding.c	Tue Jun 16 04:33:08 1998 +0000
+++ b/src/coding.c	Tue Jun 16 04:50:57 1998 +0000
@@ -2595,7 +2595,7 @@
       else
 	safe_bcopy (source, destination, src_bytes);
       src += src_bytes;
-      dst += dst_bytes;
+      dst += src_bytes;
       coding->fake_multibyte = 1;
       break;
     }
@@ -2662,18 +2662,16 @@
       if (dst_bytes)
 	bcopy (source, destination, src_bytes);
       else
-	{
-	  safe_bcopy (source, destination, src_bytes);
-	  dst_bytes = src_bytes;
-	}
-      if (coding->eol_type == CODING_EOL_CRLF)
+	safe_bcopy (source, destination, src_bytes);
+      dst_bytes = src_bytes;
+      if (coding->eol_type == CODING_EOL_CR)
 	{
 	  while (src_bytes--)
 	    {
 	      if ((c = *dst++) == '\n')
 		dst[-1] = '\r';
 	      else if (BASE_LEADING_CODE_P (c))
-		  coding->fake_multibyte = 1;
+		coding->fake_multibyte = 1;
 	    }
 	}
       else