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

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