Subject: 23.1; read_escape too greedy with "\x"

From: Łukasz Stelmach <[email-masked]>
Date: Tue, 15 Dec 2009 13:29:33 +0100

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