unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#5221: 23.1; read_escape too greedy with "\x"
@ 2009-12-15 12:29 Łukasz Stelmach
  2009-12-17 15:53 ` Andreas Schwab
  0 siblings, 1 reply; 3+ messages in thread
From: Łukasz Stelmach @ 2009-12-15 12:29 UTC (permalink / raw)
  To: bug-gnu-emacs


Emacs (read_escape() function at lread.c file) interpretinterprets
"\x3a480" string as "0x3a480" instead of ":" and "480" coming next.
Some software (most? gnupg to name one) assume these escapes represent
single bytes.

Try interpreting "\x3a480" in the *scratch* buffer.

IMHO the while() loop in read_escape for c='x' should depend on
"count < 3" condition.

Why would anyone use multibyte "\x" sequence instead of "\u" one anyway?

In GNU Emacs 23.1.1 (x86_64-pc-linux-gnu, GTK+ Version 2.16.6)
 of 2009-09-14 on nautilus, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.10604000
configured using `configure  '--build=x86_64-linux-gnu' '--host=x86_64-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=x86_64-linux-gnu' 'host_alias=x86_64-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS=''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: pl_PL.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  jabber-activity-mode: t
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
m <backspace> <backspace> <M-tab> SPC <right> <down> 
<down> C-e ) C-j <up> C-k C-k C-k C-k C-k C-h f <S-insert> 
<return> <help-echo> <down-mouse-1> <mouse-1> <down-mouse-1> 
<mouse-1> ( d e c <M-tab> o <M-tab> d <M-tab> 0 c i 
\ <backspace> <backspace> <backspace> <backspace> c 
o d i n g - s t r i n g S-SPC " \ <down-mouse-1> <mouse-movement> 
<mouse-1> 3 a <backspace> <backspace> x 3 a " SPC ' 
u t f 8 ) C-j <up> <up> <down-mouse-1> <mouse-1> <right> 
- C-e C-j <up> <up> <end> <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <left> <right> 4 
8 0 C-e C-j <up> C-x o C-x b B U G <tab> <return> . 
<return> <tab> b ł ę <backspace> ą d SPC j e s t SPC 
w SPC <help-echo> <help-echo> <down-mouse-1> <mouse-1> 
<up> <up> <up> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <backspace> c <right> 
<backspace> 5 <delete> <delete> <delete> b c C-e C-j 
<up> <up> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
\ x C-e C-j <help-echo> <help-echo> <help-echo> <down-mouse-1> 
<mouse-1> <help-echo> <down-mouse-1> <mouse-1> <double-down-mouse-1> 
<mouse-movement> <mouse-movement> <double-drag-mouse-1> 
<help-echo> <down-mouse-2> <mouse-2> SPC k t ó r e 
SPC p o ł y k a SPC w i e c e j SPC n i ż SPC d w a 
SPC z n a k i SPC M-q <up> <left> <left> <left> <left> 
<left> <left> <left> <left> <delete> <down> C-e SPC 
p o SPC " \ x " C-x C-s <help-echo> <help-echo> <down-mouse-1> 
<mouse-1> M-x r e p o SPC r SPC - <backspace> e m SPC 
b SPC <return>

Recent messages:
Entering debugger...
Mark set
Type C-x 4 C-o RET to restore the other window.
Making completion list...done
Making completion list...done
Entering debugger...
Mark set
Saving file /tmp/asdf.txt...
Wrote /tmp/asdf.txt
Making completion list...

-- 
Miłego dnia,
Łukasz Stelmach






^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: bug#5221: 23.1; read_escape too greedy with "\x"
  2009-12-15 12:29 bug#5221: 23.1; read_escape too greedy with "\x" Łukasz Stelmach
@ 2009-12-17 15:53 ` Andreas Schwab
  2009-12-18 12:04   ` Łukasz Stelmach
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Schwab @ 2009-12-17 15:53 UTC (permalink / raw)
  To: Łukasz Stelmach; +Cc: 5221, bug-gnu-emacs

Łukasz Stelmach <lukasz.stelmach@iem.pw.edu.pl> writes:

> Emacs (read_escape() function at lread.c file) interpretinterprets
> "\x3a480" string as "0x3a480" instead of ":" and "480" coming next.
> Some software (most? gnupg to name one) assume these escapes represent
> single bytes.

Then they are broken.  The syntax of strings is documented in
(elisp)String Type.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: bug#5221: 23.1; read_escape too greedy with "\x"
  2009-12-17 15:53 ` Andreas Schwab
@ 2009-12-18 12:04   ` Łukasz Stelmach
  0 siblings, 0 replies; 3+ messages in thread
From: Łukasz Stelmach @ 2009-12-18 12:04 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: 5221, bug-gnu-emacs

Andreas Schwab <schwab@linux-m68k.org> writes:

> Łukasz Stelmach <lukasz.stelmach@iem.pw.edu.pl> writes:
>
>> Emacs (read_escape() function at lread.c file) interpretinterprets
>> "\x3a480" string as "0x3a480" instead of ":" and "480" coming next.
>> Some software (most? gnupg to name one) assume these escapes represent
>> single bytes.
>
> Then they are broken.  The syntax of strings is documented in
> (elisp)String Type.

OK, good point. We need a workaround somewhere else (in GnuPG maybe?).
Please consider this bug solved/closed/non-existent.

-- 
Miłego dnia,
Łukasz Stelmach




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-12-18 12:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-15 12:29 bug#5221: 23.1; read_escape too greedy with "\x" Łukasz Stelmach
2009-12-17 15:53 ` Andreas Schwab
2009-12-18 12:04   ` Łukasz Stelmach

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