From c20ee227e260ede548ad5f0baab0da4f90d42649 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Sun, 29 Mar 2020 23:47:10 +0000
Subject: [PATCH] Use the JS-standard method of passing a variable number of
 arguments to a function (using function.apply()) rather than depending on the
 js.exec() array-args-expansion feature I recently added and then just
 removed.

---
 exec/install-xtrn.js | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/exec/install-xtrn.js b/exec/install-xtrn.js
index 4e04f598b3..5ff3ecd2ca 100644
--- a/exec/install-xtrn.js
+++ b/exec/install-xtrn.js
@@ -217,9 +217,10 @@ function main(ini_fname)
 
 		if (item.startup_dir === undefined)
 			item.startup_dir = startup_dir;
-		if (typeof item.args == 'string' && item.args.indexOf(' ') > 0)
-			item.args = item.args.split(' ');
-		var result = js.exec(item.file, item.startup_dir, {}, item.args);
+		if (!item.args)
+			items.args = "";
+		var result = js.exec.apply(null
+			,[item.file, item.startup_dir, {}].concat(item.args.split(/\s+/)));
 		if (result !== 0 && item.required)
 			return "Error " + result + " executing " + item.file;
 	}
-- 
GitLab