{
int size = strlen (in) - 1;
+ if (size < 0)
+ error ("Empty file name");
+
strcpy (out, in);
#ifdef VMS
if (! not_regular)
how_much += this;
- this_chars = this;
if (CODING_REQUIRE_DECODING (&coding)
|| CODING_REQUIRE_DETECTION (&coding))
{
this_chars = chars_in_text (BYTE_POS_ADDR (PT_BYTE + inserted - 1) + 1,
produced);
}
+ else if (! NILP (current_buffer->enable_multibyte_characters))
+ this_chars = chars_in_text (BYTE_POS_ADDR (PT_BYTE + inserted - 1) + 1,
+ this);
+ else
+ this_chars = this;
GAP_SIZE -= this;
GPT_BYTE += this;
error ("IO error reading %s: %s",
XSTRING (orig_filename)->data, strerror (errno));
else if (how_much == -2)
- error ("maximum buffer size exceeded");
+ error ("Maximum buffer size exceeded");
set_coding_system = 1;
save_errno = errno;
}
- if (CODING_REQUIRE_FLUSHING (&coding) && !coding.last_block)
+ if (CODING_REQUIRE_FLUSHING (&coding) && !coding.last_block
+ && ! failure)
{
/* We have to flush out a data. */
coding.last_block = 1;