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

Only produce MS-DOS compatible 'File' key values in TIC files

to be compliant with FTS-5006 which states "The name must be in 8x3 DOS format".

I'm not converting the filename to ALL CAPS, since that's not explicitly stated
and really should not be a problem.

This also generates an Lfile key if the generated-DOS-compatible filename
does not exactly match the actual filename in any way (not just length).
parent 26bc17de
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #2596 passed
......@@ -249,11 +249,16 @@ function hatch_file(file, area, origin, replaces)
tf.write('Origin '+origin+'\r\n');
tf.write('From '+origin+'\r\n');
tf.write('To '+link+'\r\n');
tf.write('File '+file.name+'\r\n');
if (file_getcase(file.path).length > file.path.length) {
lfile = file_getcase(file.path);
lfile.replace(/^.*\\\/([^\\\/]+)$/,'$1');
tf.write('Lfile '+lfile+'\r\n');
// FTS-5006: "The name must be in 8x3 DOS format"
var dosfname = file.name.replace(/\ /g, "");
var ext = file_getext(dosfname);
if(ext === undefined || ext === '.')
ext = "";
var basename = format("%.*s", dosfname.length - ext.length, dosfname);
dosfname = format("%.8s%.4s", basename.replace(/\./g, ""), ext);
tf.write('File '+dosfname+'\r\n');
if (dosfname != file.name) {
tf.write('Lfile '+file.name+'\r\n');
}
if (replaces)
tf.write('Replaces ' + replaces + '\r\n');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment