[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#29189: 25.3; Dired does not work with binary filenames
From: |
Eli Zaretskii |
Subject: |
bug#29189: 25.3; Dired does not work with binary filenames |
Date: |
Fri, 15 Dec 2017 11:09:48 +0200 |
Ping! Ping! Ping! Ping!
> Date: Sat, 09 Dec 2017 11:03:57 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: vianchielfaura@gmail.com, 29189@debbugs.gnu.org
>
> Ping! Ping! Ping!
>
> > Date: Fri, 01 Dec 2017 10:41:47 +0200
> > From: Eli Zaretskii <eliz@gnu.org>
> > Cc: vianchielfaura@gmail.com, 29189@debbugs.gnu.org
> >
> > Ping! Ping! I'd _really_ like to fix this for Emacs 26, but I'm
> > bothered by the potential adverse consequences of making changes in
> > such a central piece of code.
> >
> > Still hoping to get comments from Handa-san.
> >
> > > Date: Fri, 24 Nov 2017 10:52:19 +0200
> > > From: Eli Zaretskii <eliz@gnu.org>
> > > Cc: vianchielfaura@gmail.com, 29189@debbugs.gnu.org
> > >
> > > Ping! Kenichi, any comments on this issue or the proposed patch?
> > >
> > > > Date: Mon, 20 Nov 2017 20:15:55 +0200
> > > > From: Eli Zaretskii <eliz@gnu.org>
> > > > Cc: vianchielfaura@gmail.com, 29189@debbugs.gnu.org
> > > >
> > > > > From: Andreas Schwab <schwab@suse.de>
> > > > > Cc: Kenichi Handa <handa@gnu.org>, vianchielfaura@gmail.com,
> > > > > 29189@debbugs.gnu.org
> > > > > Date: Mon, 20 Nov 2017 10:48:09 +0100
> > > > >
> > > > > > + /* 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.
> > > >
> > > > Right you are, thanks. Updated patch below.
> > > >
> > > > diff --git a/src/coding.c b/src/coding.c
> > > > index d790ad0..ac55f87 100644
> > > > --- a/src/coding.c
> > > > +++ b/src/coding.c
> > > > @@ -7423,10 +7423,23 @@ 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 from multibyte
> > > > + text as single characters. */
> > > > + if (coding->src_multibyte
> > > > + && CHAR_BYTE8_HEAD_P (*src) && nbytes > 0)
> > > > + {
> > > > + c = STRING_CHAR_ADVANCE (src);
> > > > + nbytes--;
> > > > + }
> > > > + else
> > > > + {
> > > > + c = *src++;
> > > > +
> > > > + if (c & 0x80)
> > > > + c = BYTE8_TO_CHAR (c);
> > > > + }
> > > > coding->charbuf[coding->charbuf_used++] = c;
> > > > }
> > > > produce_chars (coding, Qnil, 1);
> > > >
> > > >
>
>
>
>