diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 7 |
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 | } |