mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Add unset variable feature to tix-build.
This commit is contained in:
parent
095a264d26
commit
33c7f48909
1 changed files with 8 additions and 0 deletions
|
@ -440,7 +440,11 @@ void Configure(metainfo_t* minfo)
|
||||||
assert(key);
|
assert(key);
|
||||||
char* assignment = strchr((char*) key, '=');
|
char* assignment = strchr((char*) key, '=');
|
||||||
if ( !assignment )
|
if ( !assignment )
|
||||||
|
{
|
||||||
|
if ( !strncmp(key, "unset ", strlen("unset ")) )
|
||||||
|
unsetenv(key + strlen("unset "));
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
*assignment = '\0';
|
*assignment = '\0';
|
||||||
char* value = assignment+1;
|
char* value = assignment+1;
|
||||||
setenv(key, value, 1);
|
setenv(key, value, 1);
|
||||||
|
@ -534,7 +538,11 @@ void Make(metainfo_t* minfo, const char* make_target,
|
||||||
assert(key);
|
assert(key);
|
||||||
char* assignment = strchr((char*) key, '=');
|
char* assignment = strchr((char*) key, '=');
|
||||||
if ( !assignment )
|
if ( !assignment )
|
||||||
|
{
|
||||||
|
if ( !strncmp(key, "unset ", strlen("unset ")) )
|
||||||
|
unsetenv(key + strlen("unset "));
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
*assignment = '\0';
|
*assignment = '\0';
|
||||||
char* value = assignment+1;
|
char* value = assignment+1;
|
||||||
setenv(key, value, 1);
|
setenv(key, value, 1);
|
||||||
|
|
Loading…
Add table
Reference in a new issue