From 17e943401052e9db6ef32070b20c0416ce2cde4d Mon Sep 17 00:00:00 2001
From: Andrew Borodin <aborodin@vmail.ru>
Date: Sat, 10 Oct 2009 09:35:37 +0400
Subject: [PATCH] Ticket #1700: fixed skin color parser.
Strip leading and trailing spaces in color names read from skin ini
file.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
---
src/skin/colors.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/skin/colors.c b/src/skin/colors.c
index 638fb1f..95b7df8 100644
a
|
b
|
mc_skin_color_get_from_ini_file (mc_skin_t * mc_skin, const gchar * group, const |
144 | 144 | case 0: |
145 | 145 | tmp = mc_skin_color_get_with_defaults (group, "_default_"); |
146 | 146 | if (tmp) { |
147 | | mc_skin_color->fgcolor = g_strdup (tmp->fgcolor); |
148 | | mc_skin_color->bgcolor = g_strdup (tmp->bgcolor); |
| 147 | mc_skin_color->fgcolor = g_strstrip (g_strdup (tmp->fgcolor)); |
| 148 | mc_skin_color->bgcolor = g_strstrip (g_strdup (tmp->bgcolor)); |
149 | 149 | } else { |
150 | 150 | g_strfreev (values); |
151 | 151 | g_free (mc_skin_color); |
… |
… |
mc_skin_color_get_from_ini_file (mc_skin_t * mc_skin, const gchar * group, const |
153 | 153 | } |
154 | 154 | break; |
155 | 155 | case 1: |
156 | | mc_skin_color->fgcolor = (values[0]) ? g_strdup (values[0]) : NULL; |
| 156 | mc_skin_color->fgcolor = (values[0]) ? g_strstrip (g_strdup (values[0])) : NULL; |
157 | 157 | tmp = mc_skin_color_get_with_defaults (group, "_default_"); |
158 | | mc_skin_color->bgcolor = (tmp != NULL) ? g_strdup (tmp->bgcolor) : NULL; |
| 158 | mc_skin_color->bgcolor = (tmp != NULL) ? g_strstrip (g_strdup (tmp->bgcolor)) : NULL; |
159 | 159 | break; |
160 | 160 | case 2: |
161 | | mc_skin_color->fgcolor = (values[0]) ? g_strdup (values[0]) : NULL; |
162 | | mc_skin_color->bgcolor = (values[1]) ? g_strdup (values[1]) : NULL; |
| 161 | mc_skin_color->fgcolor = (values[0]) ? g_strstrip (g_strdup (values[0])) : NULL; |
| 162 | mc_skin_color->bgcolor = (values[1]) ? g_strstrip (g_strdup (values[1])) : NULL; |
163 | 163 | break; |
164 | 164 | } |
165 | 165 | g_strfreev (values); |