Skip to content
Snippets Groups Projects
Commit 5030549b authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

chdir() instead of setenv()

parent a92e5dfa
No related branches found
No related tags found
No related merge requests found
...@@ -284,11 +284,9 @@ int parse_module(sv_alltype *sv_before,char const *svname,uid_t owner,uint8_t fo ...@@ -284,11 +284,9 @@ int parse_module(sv_alltype *sv_before,char const *svname,uid_t owner,uint8_t fo
size_t clen = sv_before->type.module.configure > 0 ? 1 : 0 ; size_t clen = sv_before->type.module.configure > 0 ? 1 : 0 ;
char const *newargv[2 + clen] ; char const *newargv[2 + clen] ;
unsigned int m = 0 ; unsigned int m = 0 ;
/** only overwrite the PWD variable char pwd[sdir.len + 12] ;
* Bash do not respect this, it set auto_strings(pwd,sdir.s,"/.configure") ;
* automatically the PWD variable. */ if (chdir(pwd) < 0) log_warnusys_return(LOG_EXIT_ZERO,"chdir to: ",pwd) ;
if (setenv("PWD",tmp.s,1) < 0) log_warnusys_return(LOG_EXIT_SYS,"set pwd environment variable") ;
newargv[m++] = tmp.s ; newargv[m++] = tmp.s ;
if (sv_before->type.module.configure > 0) if (sv_before->type.module.configure > 0)
......
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