Skip to content
Snippets Groups Projects
Commit 5ed4d0a7 authored by deuce's avatar deuce
Browse files

Fixes to make the cwd a global and correct for each xjs_load()ed script.

parent b2c66fb6
No related branches found
No related tags found
No related merge requests found
......@@ -9,17 +9,18 @@ if(this.http_request!=undefined) /* Requested through web-server */
else
xjs_filename = argv[0];
var last_cwd='';
var cwd='';
xjs_load(xjs_filename);
function xjs_load(filename) {
if(last_cwd != '') {
var old_cwd=cwd;
if(cwd != '') {
if(filename.search(/^((\/)|([A-Za-z]:[\/\\]))/)==-1)
filename=last_cwd+'/'+filename;
filename=cwd+filename;
}
var cwd=filename;
cwd=cwd.replace(/[^\\\/]*$/,'');
cwd=filename;
cwd=backslash(cwd.replace(/[^\\\/]*$/,''));
var ssjs_filename=filename+".ssjs";
// Probably a race condition on Win32
......@@ -92,9 +93,8 @@ function xjs_load(filename) {
}
}
last_cwd=cwd;
load(ssjs_filename);
cwd=old_cwd;
}
function escape_quotes(arg) {
......
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