unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Eli Zaretskii <eliz@gnu.org>
Cc: p.stephani2@gmail.com, johnw@gnu.org, nicolas@petton.fr,
	24206@debbugs.gnu.org
Subject: bug#24206: 25.1; Curly quotes generate invalid strings, leading to a segfault
Date: Sun, 14 Aug 2016 09:51:43 -0500	[thread overview]
Message-ID: <f04b0d34-c13b-bbfe-9542-5c052676271c@cs.ucla.edu> (raw)
In-Reply-To: <8337m7h1dp.fsf@gnu.org>

On 08/14/2016 09:27 AM, Eli Zaretskii wrote:
> The "length = 1" part is only correct if the argument string is
> multibyte, and should otherwise count the number of bytes in
> uLSQM/uRSQ, right?

This string is by definition multibyte at that point, since that part of 
the code is inserting a Unicode character that is not ASCII.

More generally, Fsubstitute_command_keys is quite confused about unibyte 
versus multibyte issues. It merges together a number of strings, and 
assumes that they are all multibyte iff the original string is 
multibyte, which is obviously not true in general. (This problem is not 
limited to the requoting part of the code.) In master, I've altered the 
implementation to always generate either the original string, or an 
ASCII string, or a multibyte string. Since substitute-command-keys is 
not intended to be used on encoded unibyte text, that's good enough.






  reply	other threads:[~2016-08-14 14:51 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-11 18:55 bug#24206: 25.1; Curly quotes generate invalid strings, leading to a segfault Phil
2016-08-11 20:05 ` Eli Zaretskii
2016-08-11 23:51   ` Philipp Stephani
2016-08-13  8:32     ` Eli Zaretskii
2016-08-13 12:25       ` Nicolas Petton
2016-08-14  6:33         ` John Wiegley
2016-08-14  4:54 ` Paul Eggert
2016-08-14 14:27   ` Eli Zaretskii
2016-08-14 14:51     ` Paul Eggert [this message]
2016-08-14 17:18       ` Eli Zaretskii
2016-08-15  2:04         ` Paul Eggert
2016-08-15 16:09           ` Eli Zaretskii
2016-08-15 16:46             ` Andreas Schwab
2016-08-15 18:43               ` Paul Eggert
2016-08-15 19:04                 ` Eli Zaretskii
2016-08-15 18:51               ` Eli Zaretskii
2016-08-15 19:05                 ` John Wiegley
2016-08-15 20:41                 ` Paul Eggert
2016-08-16 14:38                   ` Eli Zaretskii
2016-08-16 15:25                     ` John Wiegley
2016-08-16 16:09                       ` Nicolas Petton
2016-08-18 16:30                       ` Nicolas Petton
2016-08-18 16:41                         ` John Wiegley
2016-08-18 17:35                           ` Eli Zaretskii
2016-08-16 17:37                     ` Paul Eggert
2016-08-16 17:45                       ` John Wiegley
2016-08-16 17:55                         ` Paul Eggert
2016-08-16 17:57                           ` John Wiegley
2016-08-16 18:44                           ` Dmitry Gutov
2016-08-16 18:31                       ` Eli Zaretskii
2016-08-16 14:52                   ` Eli Zaretskii
2016-08-16 21:07                     ` Paul Eggert
2016-08-17 15:12                       ` Eli Zaretskii
2016-08-17 17:41                         ` Paul Eggert
2016-08-17 18:06                           ` Eli Zaretskii
2016-08-17 20:52                             ` Paul Eggert
2016-08-18 14:30                               ` Eli Zaretskii
2016-08-18 18:33                                 ` Paul Eggert
2016-08-18 18:58                                   ` Eli Zaretskii
2016-08-17 17:50                       ` Dmitry Gutov
2016-08-14 15:21   ` Dmitry Gutov
2016-08-15  1:53     ` Paul Eggert
2016-08-15  1:57       ` Dmitry Gutov
2016-08-15  2:05         ` Paul Eggert
2016-08-14 17:21   ` Eli Zaretskii
2016-08-14 20:16     ` Paul Eggert
2016-08-15  1:12       ` Paul Eggert

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=f04b0d34-c13b-bbfe-9542-5c052676271c@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=24206@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=johnw@gnu.org \
    --cc=nicolas@petton.fr \
    --cc=p.stephani2@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).