From: Kenichi Handa Date: Fri, 20 Feb 1998 11:14:32 +0000 (+0000) Subject: (Fwrite_region): When writing a string, give byte size X-Git-Tag: emacs-20.3~2130 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=55a7907fc825a70f29935058c3cd87423c24f027;p=emacs.git (Fwrite_region): When writing a string, give byte size to a_write. (a_write): Handle annotations correctly when writing a string. --- diff --git a/src/fileio.c b/src/fileio.c index 2a87adf6c29..c2dd2039b42 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -4229,7 +4229,8 @@ to the file, instead of any buffer contents, and END is ignored.") 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 @@ a_write (desc, addr, nbytes, bytepos, annot, coding) 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 @@ a_write (desc, addr, nbytes, bytepos, annot, coding) 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; }