[gegl] json: Properly convert strings to lowercase
- From: Jon Nordby <jonnor src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] json: Properly convert strings to lowercase
- Date: Tue, 19 Apr 2016 12:32:51 +0000 (UTC)
commit 7d03738638f1f41b3e09236128e85aab2b7ebbcb
Author: Timm Bäder <mail baedert org>
Date: Sun Apr 17 11:22:47 2016 +0200
json: Properly convert strings to lowercase
g_ascii_strdown returns a newly allocated string, so use the return
value.
operations/core/json.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/operations/core/json.c b/operations/core/json.c
index 759227d..1acd94b 100644
--- a/operations/core/json.c
+++ b/operations/core/json.c
@@ -97,9 +97,8 @@ component2geglop(const gchar *name) {
if (!name) {
return NULL;
}
- dup = g_strdup(name);
+ dup = g_ascii_strdown(name, -1);
replace_char_inline(dup, '/', ':');
- g_ascii_strdown(dup, -1);
return dup;
}
@@ -109,9 +108,8 @@ component2gtypename(const gchar *name) {
if (!name) {
return NULL;
}
- dup = g_strdup(name);
+ dup = g_ascii_strdown(name, -1);
replace_char_inline(dup, '/', '_');
- g_ascii_strdown(dup, -1);
return dup;
}
@@ -503,6 +501,7 @@ json_op_class_init (gpointer klass, gpointer class_data)
"description", (description) ? description : "",
NULL);
+ g_free(name);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]