changeset 20944:b00fa3b6e332

(Fwrite_region): When writing a string, give byte size to a_write. (a_write): Handle annotations correctly when writing a string.
author Kenichi Handa <handa@m17n.org>
date Fri, 20 Feb 1998 11:14:32 +0000
parents d5e308b7879e
children a9442d47edcb
files src/fileio.c
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/fileio.c	Fri Feb 20 01:45:50 1998 +0000
+++ b/src/fileio.c	Fri Feb 20 11:14:32 1998 +0000
@@ -4229,7 +4229,8 @@
   if (STRINGP (start))
     {
       failure = 0 > a_write (desc, XSTRING (start)->data,
-			     XSTRING (start)->size, 0, &annotations, &coding);
+			     XSTRING (start)->size_byte, 0, &annotations,
+			     &coding);
       save_errno = errno;
     }
   else if (XINT (start) != XINT (end))
@@ -4477,7 +4478,7 @@
   while (NILP (*annot) || CONSP (*annot))
     {
       tem = Fcar_safe (Fcar (*annot));
-      nextpos = 0;
+      nextpos = bytepos - 1;
       if (INTEGERP (tem))
 	nextpos = CHAR_TO_BYTE (XFASTINT (tem));
 
@@ -4498,7 +4499,7 @@
       tem = Fcdr (Fcar (*annot));
       if (STRINGP (tem))
 	{
-	  if (0 > e_write (desc, XSTRING (tem)->data, XSTRING (tem)->size,
+	  if (0 > e_write (desc, XSTRING (tem)->data, XSTRING (tem)->size_byte,
 			   coding))
 	    return -1;
 	}