From 33c7f489090c93ac9c78ee1d2ca70c9668422154 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Sat, 16 May 2015 14:46:26 +0200 Subject: [PATCH] Add unset variable feature to tix-build. --- tix/tix-build.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tix/tix-build.cpp b/tix/tix-build.cpp index 424e90f2..055b93f3 100644 --- a/tix/tix-build.cpp +++ b/tix/tix-build.cpp @@ -440,7 +440,11 @@ void Configure(metainfo_t* minfo) assert(key); char* assignment = strchr((char*) key, '='); if ( !assignment ) + { + if ( !strncmp(key, "unset ", strlen("unset ")) ) + unsetenv(key + strlen("unset ")); continue; + } *assignment = '\0'; char* value = assignment+1; setenv(key, value, 1); @@ -534,7 +538,11 @@ void Make(metainfo_t* minfo, const char* make_target, assert(key); char* assignment = strchr((char*) key, '='); if ( !assignment ) + { + if ( !strncmp(key, "unset ", strlen("unset ")) ) + unsetenv(key + strlen("unset ")); continue; + } *assignment = '\0'; char* value = assignment+1; setenv(key, value, 1);