File lxappearance-obconf-fix-error-handling.patch of Package lxappearance-obconf
From 8814f63788b4c5cddd508a9f3226a8f89a201de7 Mon Sep 17 00:00:00 2001
From: Guido Berhoerster <gber@opensuse.org>
Date: Sun, 14 Aug 2011 17:20:28 +0200
Subject: [PATCH 1/2] fix error handling when saving the config file in tree_apply()
---
src/tree.c | 19 ++++++++-----------
1 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/src/tree.c b/src/tree.c
index f6cd532..071bf6a 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -97,7 +97,6 @@ void tree_delete_node(const gchar *path)
void tree_apply()
{
gchar *p, *d;
- gboolean err;
if (obc_config_file)
p = g_strdup(obc_config_file);
@@ -109,16 +108,7 @@ void tree_apply()
obt_paths_mkdir_path(d, 0700);
g_free(d);
- if (!obt_xml_save_file(xml_i, p, TRUE)) {
- gchar *s;
- s = g_strdup_printf("An error occured while saving the "
- "config file '%s'", p);
- obconf_error(s, FALSE);
- g_free(s);
- }
- g_free(p);
-
- if (!err) {
+ if (obt_xml_save_file(xml_i, p, TRUE)) {
XEvent ce;
ce.xclient.type = ClientMessage;
@@ -134,7 +124,14 @@ void tree_apply()
XSendEvent(GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), GDK_ROOT_WINDOW(), FALSE,
SubstructureNotifyMask | SubstructureRedirectMask,
&ce);
+ } else {
+ gchar *s;
+ s = g_strdup_printf("An error occured while saving the "
+ "config file '%s'", p);
+ obconf_error(s, FALSE);
+ g_free(s);
}
+ g_free(p);
}
void tree_set_string(const gchar *node, const gchar *value)
--
1.7.3.4