GNU bug report logs - #31646
25.3; dired gets confused if filename contains linefeed char (\u000a) or (0x0a)

Previous Next

Package: emacs;

Reported by: Blaubogi <blaubogi <at> protonmail.com>

Date: Tue, 29 May 2018 17:24:02 UTC

Severity: minor

Found in version 25.3

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 31646 in the body.
You can then email your comments to 31646 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#31646; Package emacs. (Tue, 29 May 2018 17:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Blaubogi <blaubogi <at> protonmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 29 May 2018 17:24:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Blaubogi <blaubogi <at> protonmail.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 25.3;
 dired gets confused if filename contains linefeed char (\u000a) or
 (0x0a)
Date: Tue, 29 May 2018 13:11:30 -0400
[Message part 1 (text/plain, inline)]
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.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31646; Package emacs. (Tue, 29 May 2018 18:00:02 GMT) Full text and rfc822 format available.

Message #8 received at 31646 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Blaubogi <blaubogi <at> protonmail.com>
Cc: 31646 <at> debbugs.gnu.org
Subject: Re: bug#31646: 25.3;
 dired gets confused if filename contains linefeed char (\u000a) or
 (0x0a)
Date: Tue, 29 May 2018 20:59:19 +0300
> Date: Tue, 29 May 2018 13:11:30 -0400
> From: Blaubogi <blaubogi <at> protonmail.com>
> 
> 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

Did you try adding -b to dired-listing-switches?




Reply sent to Stefan Kangas <stefan <at> marxist.se>:
You have taken responsibility. (Sun, 23 Aug 2020 01:36:02 GMT) Full text and rfc822 format available.

Notification sent to Blaubogi <blaubogi <at> protonmail.com>:
bug acknowledged by developer. (Sun, 23 Aug 2020 01:36:02 GMT) Full text and rfc822 format available.

Message #13 received at 31646-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Blaubogi <blaubogi <at> protonmail.com>, 31646-done <at> debbugs.gnu.org
Subject: Re: bug#31646: 25.3; dired gets confused if filename contains
 linefeed char (\u000a) or (0x0a)
Date: Sat, 22 Aug 2020 21:35:02 -0400
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Date: Tue, 29 May 2018 13:11:30 -0400
>> From: Blaubogi <blaubogi <at> protonmail.com>
>>
>> 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
>
> Did you try adding -b to dired-listing-switches?

More information was requested, but none was given within over 2 years,
so I'm closing this bug.  If this is still an issue, please reply to
this email (use "Reply to all" in your email client) and we can reopen
the bug report.

Best regards,
Stefan Kangas




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 20 Sep 2020 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 217 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.