summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorportix <none@none>2012-09-02 21:24:06 +0200
committerportix <none@none>2012-09-02 21:24:06 +0200
commit8a9c6170017954211f5cf14e582f87a26afd5288 (patch)
tree60a3af115ea0540e0d9812adc224c5ad274af191
parentb35b9bc10d3040e1035e4a65172d7a8e739841fe (diff)
downloaddwb-8a9c6170017954211f5cf14e582f87a26afd5288.zip
dwbem: don't set config on update if config hasn't changed
-rw-r--r--tools/Makefile2
-rw-r--r--tools/dwbem.c9
2 files changed, 7 insertions, 4 deletions
diff --git a/tools/Makefile b/tools/Makefile
index b61d605a..bb565c53 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -9,7 +9,7 @@ SYSTEM_EXTENSION_DIR=$(PREFIX)/share/dwb/extensions
CFLAGS := $(CFLAGS)
CFLAGS += -std=c99
-CFLAGS += -Wall
+CFLAGS += -Wall -g
CFLAGS += -Wextra
CFLAGS += $(shell pkg-config --cflags $(LIBS))
CFLAGS += -DSYSTEM_EXTENSION_DIR=\"$(SYSTEM_EXTENSION_DIR)\"
diff --git a/tools/dwbem.c b/tools/dwbem.c
index 952aa4cb..2b02142e 100644
--- a/tools/dwbem.c
+++ b/tools/dwbem.c
@@ -499,8 +499,10 @@ add_to_loader(const char *name, const char *content, int flags)
else if ((flags & F_UPDATE))
{
data = get_data(name, m_loader, TMPL_CONFIG, 0);
- if (diff(data, matches[1], &config) == 0)
+ if (diff(data, matches[1], &config) == 0) {
notify("Config is up to date");
+ goto unwind;
+ }
else
new_config = config;
}
@@ -509,13 +511,14 @@ add_to_loader(const char *name, const char *content, int flags)
else
new_config = matches[1];
- if ( (flags & F_UPDATE) != 0 && new_config != NULL ) {
+ if ( (flags & F_UPDATE) != 0 ) {
notify("Updating extension-loader");
set_data(name, TMPL_CONFIG, new_config, false);
}
- else if ( (flags & F_NO_CONFIRM) == 0 )
+ else if ( (flags & F_NO_CONFIRM) == 0 && new_config != NULL )
set_loader(name, new_config, flags);
+unwind:
g_strfreev(matches);
g_free(config);
g_free(data);