From 44117d04632030c941ab9b4b4916830167603c1b Mon Sep 17 00:00:00 2001 From: Tomas Mlcoch Date: Mon, 30 Sep 2013 13:23:02 +0200 Subject: [PATCH] modifyrepo: Add new option 'path' useful in situations where filename contains '[' or ']' character(s). --- src/modifyrepo_shared.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/modifyrepo_shared.c b/src/modifyrepo_shared.c index 9851ed0..43241e0 100644 --- a/src/modifyrepo_shared.c +++ b/src/modifyrepo_shared.c @@ -383,14 +383,20 @@ cr_modifyrepo_parse_batchfile(const gchar *path, gchar *group = groups[x]; assert(group); - g_debug("%s: Group: %s", __func__, group); + g_debug("%s: Group: \"%s\"", __func__, group); cr_ModifyRepoTask *task = cr_modifyrepotask_new(); tasks = g_slist_append(tasks, task); gchar *tmp_str; - task->path = cr_safe_string_chunk_insert(task->chunk, group); + // As path use path option value or group + // name if no path option specified + task->path = cr_safe_string_chunk_insert_and_free(task->chunk, + g_key_file_get_string(keyfile, group, "path", NULL)); + if (!task->path) + task->path = cr_safe_string_chunk_insert(task->chunk, group); + task->type = cr_safe_string_chunk_insert_and_free(task->chunk, g_key_file_get_string(keyfile, group, "type", NULL)); task->remove = cr_key_file_get_boolean_default(keyfile, group, -- 2.7.4