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

Use isfullpath() instead of strcspn(fname,"/\\")==strlen(fname) to check

for relative paths in the module name.
parent 45e7081a
No related branches found
No related tags found
No related merge requests found
......@@ -715,15 +715,17 @@ long js_exec(const char *fname, char** args)
long double diff;
if(fname!=NULL) {
if(strcspn(fname,"/\\")==strlen(fname)) {
if(isfullpath(fname)) {
SAFECOPY(path,fname);
}
else {
SAFEPRINTF3(path,"%s%s%s",orig_cwd,fname,js_ext(fname));
if(!fexistcase(path)) {
SAFEPRINTF3(path,"%s%s%s",scfg.mods_dir,fname,js_ext(fname));
if(scfg.mods_dir[0]==0 || !fexistcase(path))
SAFEPRINTF3(path,"%s%s%s",scfg.exec_dir,fname,js_ext(fname));
}
} else
SAFECOPY(path,fname);
}
if(!fexistcase(path)) {
lprintf(LOG_ERR,"!Module file (%s) doesn't exist",path);
......
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