Blame SOURCES/0035-config-do-not-export-empty-environment-variables.patch

27390d
From cff60f93d563afdfab2025b4822410c99688d445 Mon Sep 17 00:00:00 2001
27390d
From: Jakub Filak <jfilak@redhat.com>
27390d
Date: Thu, 6 Mar 2014 21:51:11 +0100
27390d
Subject: [LIBREPORT PATCH 35/36] config: do not export empty environment
27390d
 variables
27390d
27390d
Save action of the configuration dialog converts unset environment
27390d
variables to environment variables holding empty values.
27390d
27390d
This commit adds an additional condition which prevents the
27390d
configuration dialogue from using empty string for unset environment
27390d
variables.
27390d
27390d
Closes rhbz#1073610
27390d
27390d
Signed-off-by: Jakub Filak <jfilak@redhat.com>
27390d
---
27390d
 src/gtk-helpers/config_dialog.c | 6 +++++-
27390d
 1 file changed, 5 insertions(+), 1 deletion(-)
27390d
27390d
diff --git a/src/gtk-helpers/config_dialog.c b/src/gtk-helpers/config_dialog.c
27390d
index 8276130..fb22561 100644
27390d
--- a/src/gtk-helpers/config_dialog.c
27390d
+++ b/src/gtk-helpers/config_dialog.c
27390d
@@ -125,7 +125,11 @@ static void save_value_from_widget(gpointer data, gpointer user_data)
27390d
         default:
27390d
             log("unsupported option type");
27390d
     }
27390d
-    if (val)
27390d
+
27390d
+    /* gtk_entry_get_text() returns empty string for empty text value */
27390d
+    /* so if value is empty and the old value is NULL then nothing has */
27390d
+    /* changed and we must not set option's value */
27390d
+    if (val && (val[0] != '\0' || ow->option->eo_value != NULL))
27390d
     {
27390d
         free(ow->option->eo_value);
27390d
         ow->option->eo_value = xstrdup(val);
27390d
-- 
27390d
1.8.3.1
27390d