[anjuta] build: bgo#configure project - strange environment variables behaviour
- From: Sebastien Granjoux <sgranjoux src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta] build: bgo#configure project - strange environment variables behaviour
- Date: Sat, 8 Sep 2012 17:39:38 +0000 (UTC)
commit ec405a8f762b38fce1a76b2d798d88ed3d8d9c7a
Author: SÃbastien Granjoux <seb sfo free fr>
Date: Sat Sep 8 19:25:52 2012 +0200
build: bgo#configure project - strange environment variables behaviour
libanjuta/anjuta-environment-editor.c | 9 +++------
plugins/build-basic-autotools/build-options.c | 1 +
plugins/build-basic-autotools/configuration-list.c | 8 ++++++++
plugins/build-basic-autotools/configuration-list.h | 1 +
4 files changed, 13 insertions(+), 6 deletions(-)
---
diff --git a/libanjuta/anjuta-environment-editor.c b/libanjuta/anjuta-environment-editor.c
index 373893e..1f7997d 100644
--- a/libanjuta/anjuta-environment-editor.c
+++ b/libanjuta/anjuta-environment-editor.c
@@ -668,16 +668,13 @@ anjuta_environment_editor_set_variable (AnjutaEnvironmentEditor *editor, const g
gboolean valid;
gchar *name;
const gchar *equal;
- guint len = 0;
+ guint len;
model = editor->model;
/* Check is variable is already existing */
equal = strchr (variable, '=');
- if (equal != NULL)
- {
- len = equal - variable;
- }
+ len = equal != NULL ? equal - variable : 0;
for (valid = gtk_tree_model_get_iter_first (model, &iter); valid; valid = gtk_tree_model_iter_next (model, &iter))
{
@@ -685,7 +682,7 @@ anjuta_environment_editor_set_variable (AnjutaEnvironmentEditor *editor, const g
ENV_NAME_COLUMN, &name,
-1);
if (((len == 0) && (strcmp (name, variable) == 0)) ||
- ((len != 0) && (strncmp (name, variable, len) == 0) && (name[len] == '=')))
+ ((len != 0) && (strncmp (name, variable, len) == 0) && (name[len] == '\0')))
{
break;
}
diff --git a/plugins/build-basic-autotools/build-options.c b/plugins/build-basic-autotools/build-options.c
index a358364..4716103 100644
--- a/plugins/build-basic-autotools/build-options.c
+++ b/plugins/build-basic-autotools/build-options.c
@@ -376,6 +376,7 @@ build_dialog_configure (GtkWindow* parent, const gchar *project_root_uri, BuildC
build_gtk_file_chooser_keep_folder (GTK_FILE_CHOOSER (dlg.build_dir_chooser), uri);
g_free (uri);
+ build_configuration_clear_variables (cfg);
mod_var = anjuta_environment_editor_get_modified_variables (ANJUTA_ENVIRONMENT_EDITOR (dlg.env_editor));
if ((mod_var != NULL) && (*mod_var != NULL))
{
diff --git a/plugins/build-basic-autotools/configuration-list.c b/plugins/build-basic-autotools/configuration-list.c
index 513816f..dd2c604 100644
--- a/plugins/build-basic-autotools/configuration-list.c
+++ b/plugins/build-basic-autotools/configuration-list.c
@@ -461,6 +461,14 @@ build_configuration_get_args (BuildConfiguration *cfg)
}
void
+build_configuration_clear_variables (BuildConfiguration *cfg)
+{
+ g_list_foreach (cfg->env, (GFunc)g_free, NULL);
+ g_list_free (cfg->env);
+ cfg->env = NULL;
+}
+
+void
build_configuration_set_variable (BuildConfiguration *cfg, const gchar *var)
{
GList *item;
diff --git a/plugins/build-basic-autotools/configuration-list.h b/plugins/build-basic-autotools/configuration-list.h
index 6bfdca5..9f9ddc1 100644
--- a/plugins/build-basic-autotools/configuration-list.h
+++ b/plugins/build-basic-autotools/configuration-list.h
@@ -48,6 +48,7 @@ gchar *build_configuration_list_get_build_uri (BuildConfigurationList *list, Bui
const gchar *build_configuration_get_relative_build_uri (BuildConfiguration *cfg);
void build_configuration_set_args (BuildConfiguration *cfg, const gchar *args);
const gchar *build_configuration_get_args (BuildConfiguration *cfg);
+void build_configuration_clear_variables (BuildConfiguration *cfg);
void build_configuration_set_variable (BuildConfiguration *cfg, const gchar *var);
GList *build_configuration_get_variables (BuildConfiguration *cfg);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]