bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#29189: 25.3; Dired does not work with binary filenames


From: Andreas Schwab
Subject: bug#29189: 25.3; Dired does not work with binary filenames
Date: Mon, 20 Nov 2017 10:48:09 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

On Nov 18 2017, Eli Zaretskii <eliz@gnu.org> wrote:

> I found that the alternative patch below solves the original problem
> without any changes needed in files.el, and without introducing any
> performance hits.  Does anyone see a problem with this proposed patch?
> Kenichi?
>
> diff --git a/src/coding.c b/src/coding.c
> index d790ad0..eaad0d7 100644
> --- a/src/coding.c
> +++ b/src/coding.c
> @@ -7423,10 +7423,21 @@ decode_coding (struct coding_system *coding)
>  
>         while (nbytes-- > 0)
>           {
> -           int c = *src++;
> +           int c;
>  
> -           if (c & 0x80)
> -             c = BYTE8_TO_CHAR (c);
> +           /* Copy raw bytes in their 2-byte forms as single characters.  */
> +           if (CHAR_BYTE8_HEAD_P (*src) && nbytes > 0)
> +             {
> +               c = STRING_CHAR_ADVANCE (src);

CHAR_BYTE8_HEAD_P and STRING_CHAR_ADVANCE are only valid for multibyte
strings.  I don't think it makes sense to use them for unibyte strings.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."





reply via email to

[Prev in Thread] Current Thread [Next in Thread]