Skip to content
Snippets Groups Projects
Commit b78925ba authored by Eric Oulashin's avatar Eric Oulashin
Browse files

DD file lister: lfexpand() seems to do what I wrote my own function for in the last commit

parent 23c6f1df
No related branches found
No related tags found
2 merge requests!463MRC mods by Codefenix (2024-10-20),!231DD file lister: lfexpand() seems to do what I wrote my own function for in the last commit
Pipeline #3428 passed
......@@ -581,7 +581,7 @@ function showFileInfo(pFileList, pFileListMenu)
// may be a kludge, and perhaps there's a better solution..
fileDesc = fileDesc.replace(/^\x01[nN]/, "");
// Fix line endings if necessary
fileDesc = fixStrLineEndings(fileDesc);
fileDesc = lfexpand(fileDesc);
}
else
fileDesc = "";
......@@ -694,21 +694,6 @@ function splitStrAndCombineWithRN(pStr, pSplitStr)
return newStr;
}
// Fixes line endings in a string
function fixStrLineEndings(pStr)
{
if (typeof(pStr) !== "string")
return "";
// If there's only a return or only a newline, split & recombine with \r\n
var newStr = pStr;
if (/[^\r]\n[^\r]/.test(newStr)) // Only a newline
newStr = splitStrAndCombineWithRN(newStr, "\n");
else if (/[^\n]\r[^\n]/.test(newStr)) // Only a carriage return
newStr = splitStrAndCombineWithRN(newStr, "\r");
return newStr;
}
// Lets the user view a file.
//
// Parameters:
......@@ -3227,7 +3212,7 @@ function populateFileList(pSearchMode)
{
gFileList[i].extdesc = gFileList[i].extdesc.substr(0, gFileList[i].extdesc.length-2);
// Fix line endings if necessary
gFileList[i].extdesc = fixStrLineEndings(gFileList[i].extdesc);
gFileList[i].extdesc = lfexpand(gFileList[i].extdesc);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment