all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Blaubogi <blaubogi@protonmail.com>
To: 31646@debbugs.gnu.org
Subject: bug#31646: 25.3; dired gets confused if filename contains linefeed char (\u000a) or (0x0a)
Date: Tue, 29 May 2018 13:11:30 -0400	[thread overview]
Message-ID: <6tMo_gqPWPD3xKs6iBSZZoS_vW_mB9eXFKiRYtVkUYopEoYB1StYPCPn60UaZkwTxblRum083Vye5GTHaP9sYfQdVB5lunM4ZW0lj-mVfd8=@protonmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1288 bytes --]

Hello,

If a filename contains a linefeed character, dired does not escape it. Instead dired shows it in the buffer which make the remaining characters of the name appear on the beginning of the next line. (using linefeed with code 0x0A or unicode \u000a)

  -rwxrwxrwx 1 root    4 29.05.2018 12:37:14 ffff
  -rwxrwxrwx 1 root    4 29.05.2018 18:42:22 test
test
  -rwxrwxrwx 1 root    4 29.05.2018 12:37:14 vtvt

This causes all kinds of trouble:
- file can't be deleted
- regular expression for file recognition doesn't work any longer:
'no file on this line'
- hide-details mode does not show ANY files in this dir
- probably more

System:
In GNU Emacs 25.3.1 (x86_64-suse-linux-gnu, GTK+ Version 3.20.10)
of 2018-05-25 built on lamb08
Windowing system distributor 'The X.Org Foundation', version 11.0.11803000
System Description: openSUSE Leap 42.3

ext4 filesystem.

To reproduce:
Using ruby I created a file like this:

dir = "/mnt/loop0/test"
fname = "test" + "\u000a" + "test"
File.open(File.join(dir, fname), "w") { |fd| fd.write("test") }

M-x dired /mnt/loop0/test

I didn't test emacs under Microsoft Windows.
I did test using ntfs filesystem instead of ext4 which makes no difference.

Best regards

Sent from [ProtonMail](https://protonmail.com), Swiss-based encrypted email.

[-- Attachment #2: Type: text/html, Size: 2100 bytes --]

             reply	other threads:[~2018-05-29 17:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-29 17:11 Blaubogi [this message]
2018-05-29 17:59 ` bug#31646: 25.3; dired gets confused if filename contains linefeed char (\u000a) or (0x0a) Eli Zaretskii
2020-08-23  1:35   ` Stefan Kangas

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

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

  git send-email \
    --in-reply-to='6tMo_gqPWPD3xKs6iBSZZoS_vW_mB9eXFKiRYtVkUYopEoYB1StYPCPn60UaZkwTxblRum083Vye5GTHaP9sYfQdVB5lunM4ZW0lj-mVfd8=@protonmail.com' \
    --to=blaubogi@protonmail.com \
    --cc=31646@debbugs.gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.