summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorportix <none@none>2012-08-31 23:50:42 +0200
committerportix <none@none>2012-08-31 23:50:42 +0200
commit53bc8952f89d19e9f72bf62ab045058ef91094c3 (patch)
tree06ac828379a365b949b6057dd6b77a8d23aaf1b3
parenta8769a4336f090fd695071c35640ebc45b35d60a (diff)
downloaddwb-53bc8952f89d19e9f72bf62ab045058ef91094c3.zip
Fixing .installed not updated if it is present but empty
-rw-r--r--tools/dwbem.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/dwbem.c b/tools/dwbem.c
index 0bef876d..1ca4449b 100644
--- a/tools/dwbem.c
+++ b/tools/dwbem.c
@@ -116,8 +116,14 @@ regex_replace_file(const char *path, const char *regex, const char *replacement)
if (g_file_set_contents(path, content, -1, NULL))
ret = 0;
}
+ else {
+ g_file_set_contents(path, replacement, -1, NULL);
+ }
g_strfreev(matches);
}
+ else {
+ g_file_set_contents(path, replacement, -1, NULL);
+ }
g_free(content);
return ret;
}
@@ -288,7 +294,7 @@ set_loader(const char *name, const char *config, int flags) {
char *script = NULL;
char *shortcut = NULL, *command = NULL;
gboolean load = true;
- notify("Adding "EXT(%s)" to extension loader", name, m_loader);
+ notify("Updating extension-loader", name, m_loader);
if (flags & F_BIND) {
while ((shortcut = get_response("Shortcut for toggling "EXT(%s)"?", name)) == NULL || *shortcut == '\0')
g_free(shortcut);
@@ -576,7 +582,7 @@ cl_uninstall(const char *name) {
g_free(path);
char *regex = REGEX_REPLACE(SCRIPT, name);
if (regex_replace_file(m_loader, regex, NULL) != -1) {
- notify("Updating %s", m_loader);
+ notify("Updating extension-loader");
}
g_free(regex);
regex = g_strdup_printf("(?<=^|\n)%s\\s\\w+\n", name);