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

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