diff options
| author | Eli Zaretskii | 2018-01-06 10:56:21 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2018-01-06 10:56:21 +0200 |
| commit | a377c652b55db4f118076fec2cdbd65e0d61e31a (patch) | |
| tree | 91df94728e0bc3703e000460a50b1727adf73178 /src/coding.c | |
| parent | d9d6e8a04c81235f805f6625e6d26aaaa6797b9d (diff) | |
| download | emacs-a377c652b55db4f118076fec2cdbd65e0d61e31a.tar.gz emacs-a377c652b55db4f118076fec2cdbd65e0d61e31a.zip | |
Fix Dired display and operations on file names with raw bytes
* src/coding.c (decode_coding): When flushing remaining raw bytes
from multibyte text, copy 2-byte forms of eight-bit-*
characters as single characters, not as 2 raw bytes. (Bug#29189)
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/coding.c b/src/coding.c index 35f85052c98..a7b040e2712 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -7423,10 +7423,23 @@ decode_coding (struct coding_system *coding) | |||
| 7423 | 7423 | ||
| 7424 | while (nbytes-- > 0) | 7424 | while (nbytes-- > 0) |
| 7425 | { | 7425 | { |
| 7426 | int c = *src++; | 7426 | int c; |
| 7427 | 7427 | ||
| 7428 | if (c & 0x80) | 7428 | /* Copy raw bytes in their 2-byte forms from multibyte |
| 7429 | c = BYTE8_TO_CHAR (c); | 7429 | text as single characters. */ |
| 7430 | if (coding->src_multibyte | ||
| 7431 | && CHAR_BYTE8_HEAD_P (*src) && nbytes > 0) | ||
| 7432 | { | ||
| 7433 | c = STRING_CHAR_ADVANCE (src); | ||
| 7434 | nbytes--; | ||
| 7435 | } | ||
| 7436 | else | ||
| 7437 | { | ||
| 7438 | c = *src++; | ||
| 7439 | |||
| 7440 | if (c & 0x80) | ||
| 7441 | c = BYTE8_TO_CHAR (c); | ||
| 7442 | } | ||
| 7430 | coding->charbuf[coding->charbuf_used++] = c; | 7443 | coding->charbuf[coding->charbuf_used++] = c; |
| 7431 | } | 7444 | } |
| 7432 | produce_chars (coding, Qnil, 1); | 7445 | produce_chars (coding, Qnil, 1); |