aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa1998-02-20 11:14:32 +0000
committerKenichi Handa1998-02-20 11:14:32 +0000
commit55a7907fc825a70f29935058c3cd87423c24f027 (patch)
treedbcc886337adda70023a9a0f274b4aa705b4ed8a /src
parent7d862e077989b7399efc184b35f4ea643c19b2e4 (diff)
downloademacs-55a7907fc825a70f29935058c3cd87423c24f027.tar.gz
emacs-55a7907fc825a70f29935058c3cd87423c24f027.zip
(Fwrite_region): When writing a string, give byte size
to a_write. (a_write): Handle annotations correctly when writing a string.
Diffstat (limited to 'src')
-rw-r--r--src/fileio.c7
1 files changed, 4 insertions, 3 deletions
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.")
4229 if (STRINGP (start)) 4229 if (STRINGP (start))
4230 { 4230 {
4231 failure = 0 > a_write (desc, XSTRING (start)->data, 4231 failure = 0 > a_write (desc, XSTRING (start)->data,
4232 XSTRING (start)->size, 0, &annotations, &coding); 4232 XSTRING (start)->size_byte, 0, &annotations,
4233 &coding);
4233 save_errno = errno; 4234 save_errno = errno;
4234 } 4235 }
4235 else if (XINT (start) != XINT (end)) 4236 else if (XINT (start) != XINT (end))
@@ -4477,7 +4478,7 @@ a_write (desc, addr, nbytes, bytepos, annot, coding)
4477 while (NILP (*annot) || CONSP (*annot)) 4478 while (NILP (*annot) || CONSP (*annot))
4478 { 4479 {
4479 tem = Fcar_safe (Fcar (*annot)); 4480 tem = Fcar_safe (Fcar (*annot));
4480 nextpos = 0; 4481 nextpos = bytepos - 1;
4481 if (INTEGERP (tem)) 4482 if (INTEGERP (tem))
4482 nextpos = CHAR_TO_BYTE (XFASTINT (tem)); 4483 nextpos = CHAR_TO_BYTE (XFASTINT (tem));
4483 4484
@@ -4498,7 +4499,7 @@ a_write (desc, addr, nbytes, bytepos, annot, coding)
4498 tem = Fcdr (Fcar (*annot)); 4499 tem = Fcdr (Fcar (*annot));
4499 if (STRINGP (tem)) 4500 if (STRINGP (tem))
4500 { 4501 {
4501 if (0 > e_write (desc, XSTRING (tem)->data, XSTRING (tem)->size, 4502 if (0 > e_write (desc, XSTRING (tem)->data, XSTRING (tem)->size_byte,
4502 coding)) 4503 coding))
4503 return -1; 4504 return -1;
4504 } 4505 }