diff options
author | liping ke <liping.ke@intel.com> | 2010-09-01 17:47:10 +0800 |
---|---|---|
committer | Joshua Lock <josh@linux.intel.com> | 2010-09-01 12:54:59 +0100 |
commit | b2f7281cec01de89ecc358d9c005f66e74017632 (patch) | |
tree | 57f2f30d89b4187790c54cc13461725c6a96d8e6 | |
parent | 8b811d7cad28fd0f79db0f1fa1dbfc947b478993 (diff) | |
download | anjuta-poky-b2f7281cec01de89ecc358d9c005f66e74017632.tar.gz anjuta-poky-b2f7281cec01de89ecc358d9c005f66e74017632.tar.bz2 anjuta-poky-b2f7281cec01de89ecc358d9c005f66e74017632.zip |
Bug fix: Load unset environment vars into old hash for unset purpose
This patch is a bug fix for restore original environment before
activating poky sdk plugin.
when deactive poky plugin, we need to unset all set envrionment,
otherwise, when deactivating poky plugin, native compile environment
will be polluted. So if non-poky environment does not have the env var
such as "CC", we still need to save it in the hash table for later
unset operation. I save the unset environment value into old hash
table as "null" for easy to unified operation (g_free will be
automatically called in hash destructor).
Signed-off-by: Liping Ke <liping.ke@intel.com>
-rw-r--r-- | src/beaver-util.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/beaver-util.c b/src/beaver-util.c index 0461359..97e27b8 100644 --- a/src/beaver-util.c +++ b/src/beaver-util.c @@ -252,6 +252,8 @@ update_env_hash(gchar *filename, GHashTable *hash_configs, g_debug("Save old ENV: key %s value %s", key, env_value); if (env_value) g_hash_table_insert(*old_hash_configs, g_strdup(key), g_strdup(env_value)); + else + g_hash_table_insert(*old_hash_configs, g_strdup(key), g_strdup("null")); } } } |