Commit 55a7907f authored by Kenichi Handa's avatar Kenichi Handa
Browse files

(Fwrite_region): When writing a string, give byte size

to a_write.
(a_write): Handle annotations correctly when writing a string.
parent 7d862e07
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment