Subject: bug#22477: 24.5; Dired does not work if file names contain newlines

From: Aura Kelloniemi <[email-masked]>
Date: Wed, 27 Jan 2016 14:21:09 +0200

1. Create a file which contains a newline character in its name.
2. Open the directory where the newly created file resides in dired.
3. Dired buffer is garbled and the cursor is positioned at the end of the
buffer. No files can be visited (whether they contain newlines in their names
or not) (Dired says: "No file on this line").

My ls version is: ls (GNU coreutils) 8.25
In my test directory the output of ls -l --dired looks like this:
  total 8
  -rw------- 1 aura users  2 Jan 27 13:37 ''\''Hello world'\''.txt'
  -rw------- 1 aura users 17 Jan 27 13:47 'Hello'$'\n''World.txt'
//DIRED// 52 77 120 143
//DIRED-OPTIONS// --quoting-style=shell-escape

In GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.6)
 of 2015-09-10 on foutrelis
Configured using:
 `configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --with-x-toolkit=gtk3 --with-xft 'CFLAGS=-march=x86-64
 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4'
 CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro'

Important settings:
  value of $LC_COLLATE: C
  value of $LANG: fi_FI.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Dired by name

Minor modes in effect:
  gpm-mouse-mode: t
  minibuffer-electric-default-mode: t
  icomplete-mode: t
  diff-auto-refine-mode: t
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t

Recent messages:
[deleted, not necessary]

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug sendmail mule-util t-mouse w3m-filter w3m
browse-url doc-view jka-compr dired image-mode timezone w3m-hist w3m-fb
bookmark-w3m w3m-ems w3m-ccl ccl w3m-favicon w3m-image w3m-proc w3m-util
haskell-interactive-mode haskell-presentation-mode haskell-mode
haskell-indentation haskell-sort-imports haskell-lexeme rx
haskell-align-imports haskell-complete-module flymake dabbrev
haskell-font-lock haskell-collapse haskell-process haskell-session
haskell-string haskell-compat noutline outline etags url-util url-parse
auth-source eieio byte-opt bytecomp byte-compile cl-extra cconv eieio-core
gnus-util time-date url-vars json haskell-navigate-imports haskell-compile
haskell-cabal haskell-utils haskell-customize compile comint ansi-color ring
minibuf-eldef ido icomplete company pcase cus-start cus-load notmuch hl-line
notmuch-message notmuch-maildir-fcc notmuch-hello edmacro kmacro wid-edit
notmuch-tree notmuch-parser notmuch-show notmuch-print notmuch-crypto
notmuch-mua notmuch-address notmuch-wash diff-mode easy-mmode coolj
notmuch-query goto-addr thingatpt icalendar diary-lib diary-loaddefs cal-menu
calendar cal-loaddefs notmuch-tag crm notmuch-lib advice notmuch-version cl gv
cl-loaddefs cl-lib message idna format-spec rfc822 mml mailabbrev mail-utils
gmm-utils mailheader mm-view mml-smime mml-sec smime password-cache dig
mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mm-util help-fns mail-prsvr dired-single align info easymenu
package epg-config warnings server tooltip electric uniquify ediff-hook
vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan
thai tai-viet lao korean japanese hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple
abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule custom
widget hashtable-print-readable backquote make-network-process dbusbind
gfilenotify dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty emacs)

Memory information:
((conses 16 231966 12461)
 (symbols 48 33370 0)
 (miscs 40 44 150)
 (strings 32 62167 11179)
 (string-bytes 1 1719435)
 (vectors 16 24064)
 (vector-slots 8 548856 5180)
 (floats 8 150 299)
 (intervals 56 273 24)
 (buffers 960 14)
 (heap 1024 46043 958))

-- 
Aura