Skip to content
Snippets Groups Projects
Commit a77e846b authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Strip carriage returns from extended descriptions

On Windows, CRs in extended descriptions could result in output of
\r\r\n which could be displayed as 2 newlines (e.g. in notepad.exe).
Since the \n -> \r\n expansion already happens on Windows stdout,
we don't want them in the processed input (file metadata).

As reported by DesotoFireflite (VALHALLA), thank you!
parent b67a5a26
Branches
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -393,6 +393,7 @@ function list_file(file, fmt, props) ...@@ -393,6 +393,7 @@ function list_file(file, fmt, props)
if(name == 'name') if(name == 'name')
a.push(FileBase().format_name(p, name_len, options.pad)); a.push(FileBase().format_name(p, name_len, options.pad));
else if(name == 'extdesc') { else if(name == 'extdesc') {
p = p.replace(/\r/g, '');
if(both_desc) if(both_desc)
a.push(p.replace(/([^\n]+)/g, (extdesc_prefix + "$&")).trimRight()); a.push(p.replace(/([^\n]+)/g, (extdesc_prefix + "$&")).trimRight());
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment