Commits (1)
  • Rob Swindell's avatar
    Strip carriage returns from extended descriptions · a77e846b
    Rob Swindell authored
    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!
...@@ -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