unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: handa@gnu.org
Cc: vianchielfaura@gmail.com, 29189@debbugs.gnu.org
Subject: bug#29189: 25.3; Dired does not work with binary filenames
Date: Fri, 01 Dec 2017 10:41:47 +0200	[thread overview]
Message-ID: <83k1y63kms.fsf@gnu.org> (raw)
In-Reply-To: <83o9ns9hz0.fsf@gnu.org> (message from Eli Zaretskii on Fri, 24 Nov 2017 10:52:19 +0200)

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);
> > 
> > 
> > 
> > 
> 
> 
> 
> 





  reply	other threads:[~2017-12-01  8:41 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-07  9:03 bug#29189: 25.3; Dired does not work with binary filenames Allen Li
2017-11-07 10:00 ` Andreas Schwab
2017-11-07 17:08   ` Eli Zaretskii
2017-11-08  5:12     ` Allen Li
2017-11-08  6:22   ` Allen Li
2017-11-08  8:44     ` Eli Zaretskii
2017-11-11  6:59       ` Allen Li
2017-11-11  8:20         ` Eli Zaretskii
2017-11-11 14:18           ` Eli Zaretskii
2017-11-11 15:21             ` Eli Zaretskii
2017-11-16  6:31               ` Allen Li
2017-11-16 16:00                 ` Eli Zaretskii
2017-11-18 14:42                   ` Eli Zaretskii
2017-11-20  9:48                     ` Andreas Schwab
2017-11-20 18:15                       ` Eli Zaretskii
2017-11-24  8:52                         ` Eli Zaretskii
2017-12-01  8:41                           ` Eli Zaretskii [this message]
2017-12-09  9:03                             ` Eli Zaretskii
2017-12-15  9:09                               ` Eli Zaretskii
2017-12-02  5:21                         ` Allen Li
2017-12-02  9:01                           ` Eli Zaretskii
2018-01-05 22:16                     ` Stefan Monnier
     [not found]                       ` <83h8rz9x6k.fsf@gnu.org>
     [not found]                         ` <jwvbmi72fak.fsf-monnier+emacs@gnu.org>
2018-01-06 16:04                           ` Eli Zaretskii
2018-01-07 15:20                             ` Stefan Monnier
2018-01-07 17:53                               ` Eli Zaretskii
     [not found] <CADbSrJytKAysg4DRNR4iJD5JJbn7iwi_28Gh_oabaE-rnVyqLw@mail.gmail.com>
2018-09-09  0:31 ` Allen Li
2018-09-09  6:12   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83k1y63kms.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=29189@debbugs.gnu.org \
    --cc=handa@gnu.org \
    --cc=vianchielfaura@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).