Skip to content
Snippets Groups Projects
Commit 54d9429d authored by rswindell's avatar rswindell
Browse files

Insure the startup_dir ends in a slash/backslash. This is especially important

for the json-service.ini "dir" key. The code that parses that value is not
very tolerant of the absence of a trailing slash.
parent 1f514511
No related branches found
No related tags found
No related merge requests found
......@@ -232,6 +232,7 @@ function install(ini_fname)
return "Failed to read " + system.ctrl_dir + "xtrn.cnf";
var startup_dir = ini_fname.substr(0, Math.max(ini_fname.lastIndexOf("/"), ini_fname.lastIndexOf("\\"), 0));
startup_dir = backslash(startup_dir);
const types = {
prog: { desc: "External Program", struct: "xtrn" },
......@@ -312,7 +313,8 @@ function install(ini_fname)
if(!file.open(file.exists ? 'r+':'w+'))
return "Error " + file.error + " opening " + file.name;
var result = true;
print(JSON.stringify(item));
if (options.debug)
print(JSON.stringify(item));
for(var k in item.keys) {
print("Setting " + item.keys[k] + " = " + eval(item.values[k]));
result = file.iniSetValue(item.section, item.keys[k], eval(item.values[k]));
......
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