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