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

Resolve full path to specified ctrl directory, before chdir

If a relative path to the ctrl directory is specified on the command-line
or in the SBBSCTRL environment variable, the loading of ctrl/*.ini would
fail after the changing of the working directory.

We should probably get replace all use of FULLPATH with _fullpath someday,
but for now, I just went with majority-rule.
parent 4ad78af9
No related branches found
No related tags found
1 merge request!455Update branch with changes from master
......@@ -1456,6 +1456,9 @@ int main(int argc, char **argv, char** env)
strcpy(scfg.sys_inetaddr, "example.com");
scfg.prepped = true;
#else
char relpath[PATH_MAX + 1];
SAFECOPY(relpath, scfg.ctrl_dir);
FULLPATH(scfg.ctrl_dir, relpath, sizeof scfg.ctrl_dir);
if(change_cwd && chdir(scfg.ctrl_dir)!=0)
fprintf(errfp,"!ERROR changing directory to: %s\n", scfg.ctrl_dir);
......
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