nfqws,tpws: set EXEDIR env var to use in @config

This commit is contained in:
bol-van
2024-11-14 10:57:02 +03:00
parent 4d47749e7c
commit ce33a27c57
6 changed files with 23 additions and 3 deletions

View File

@@ -367,14 +367,14 @@ void fill_random_az09(uint8_t *p,size_t sz)
}
}
bool cd_to_exe_dir(const char *argv0)
bool set_env_exedir(const char *argv0)
{
char *s,*d;
bool bOK=false;
if ((s = strdup(argv0)))
{
if ((d = dirname(s)))
bOK = !chdir(d);
setenv("EXEDIR",s,1);
free(s);
}
return bOK;