aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorEli Zaretskii2013-11-18 18:45:48 +0200
committerEli Zaretskii2013-11-18 18:45:48 +0200
commit18b35e2c7a3ff95fb4a07e58c3f57c70c65c0701 (patch)
tree7a837a755a7c22d3258408cb384d01479ad88232 /src/coding.c
parentdf87c56cdf6c8c13e8760bdc409e2eb0fda55b0b (diff)
parent37c790b38599cc80a16c6a76152abbf8160fe2a1 (diff)
downloademacs-18b35e2c7a3ff95fb4a07e58c3f57c70c65c0701.tar.gz
emacs-18b35e2c7a3ff95fb4a07e58c3f57c70c65c0701.zip
Merge from mainline.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/coding.c b/src/coding.c
index 69b01553e7f..4ee55f7c8e6 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -9358,6 +9358,14 @@ code_convert_region (Lisp_Object start, Lisp_Object end,
9358 setup_coding_system (coding_system, &coding); 9358 setup_coding_system (coding_system, &coding);
9359 coding.mode |= CODING_MODE_LAST_BLOCK; 9359 coding.mode |= CODING_MODE_LAST_BLOCK;
9360 9360
9361 if (BUFFERP (dst_object) && !EQ (dst_object, src_object))
9362 {
9363 struct buffer *buf = XBUFFER (dst_object);
9364 ptrdiff_t buf_pt = BUF_PT (buf);
9365
9366 invalidate_buffer_caches (buf, buf_pt, buf_pt);
9367 }
9368
9361 if (encodep) 9369 if (encodep)
9362 encode_coding_object (&coding, src_object, from, from_byte, to, to_byte, 9370 encode_coding_object (&coding, src_object, from, from_byte, to, to_byte,
9363 dst_object); 9371 dst_object);
@@ -9447,6 +9455,15 @@ code_convert_string (Lisp_Object string, Lisp_Object coding_system,
9447 coding.mode |= CODING_MODE_LAST_BLOCK; 9455 coding.mode |= CODING_MODE_LAST_BLOCK;
9448 chars = SCHARS (string); 9456 chars = SCHARS (string);
9449 bytes = SBYTES (string); 9457 bytes = SBYTES (string);
9458
9459 if (BUFFERP (dst_object))
9460 {
9461 struct buffer *buf = XBUFFER (dst_object);
9462 ptrdiff_t buf_pt = BUF_PT (buf);
9463
9464 invalidate_buffer_caches (buf, buf_pt, buf_pt);
9465 }
9466
9450 if (encodep) 9467 if (encodep)
9451 encode_coding_object (&coding, string, 0, 0, chars, bytes, dst_object); 9468 encode_coding_object (&coding, string, 0, 0, chars, bytes, dst_object);
9452 else 9469 else
@@ -9499,6 +9516,12 @@ decode_file_name (Lisp_Object fname)
9499Lisp_Object 9516Lisp_Object
9500encode_file_name (Lisp_Object fname) 9517encode_file_name (Lisp_Object fname)
9501{ 9518{
9519 /* This is especially important during bootstrap and dumping, when
9520 file-name encoding is not yet known, and therefore any non-ASCII
9521 file names are unibyte strings, and could only be thrashed if we
9522 try to encode them. */
9523 if (!STRING_MULTIBYTE (fname))
9524 return fname;
9502#ifdef WINDOWSNT 9525#ifdef WINDOWSNT
9503 /* The w32 build pretends to use UTF-8 for file-name encoding, and 9526 /* The w32 build pretends to use UTF-8 for file-name encoding, and
9504 converts the file names either to UTF-16LE or to the system ANSI 9527 converts the file names either to UTF-16LE or to the system ANSI