From 5b20fb181ecfb3b8eefb660cd069fec14dbc25fe Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Tue, 27 Sep 2022 08:32:17 +0200 Subject: [PATCH] Cosmetics --- cmirror.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/cmirror.c b/cmirror.c index 4c3e457..709e37a 100644 --- a/cmirror.c +++ b/cmirror.c @@ -112,9 +112,8 @@ static gboolean fn_unescape_cb(const GMatchInfo *match_info, GString *result, g static char *fn_unescape(char *fn) { static GRegex *regex = NULL; - if (!regex) { + if (!regex) regex = compile_pattern("\\\\x([0-9a-f]{0,2})"); - } GError *error; char *ret = g_regex_replace_eval(regex, fn, -1, 0, 0, fn_unescape_cb, NULL, &error); if (!ret) @@ -495,11 +494,10 @@ static void add_clean_dir(char *dir) { const char *entry; while ( (entry = g_dir_read_name(d)) ) { char *path = g_strdup_printf("%s/%s", dir, entry); - if (is_excepted(path)) { + if (is_excepted(path)) free(path); - } else { + else g_hash_table_insert(CLEAN, path, path); - } } g_dir_close(d); } @@ -1445,7 +1443,6 @@ static void master(char *master_path, char *target) { } } - int main(int argc, char **argv) { char *argv0 = argv[0];