Merge branch '1574_color_string_parser_error'

* 1574_color_string_parser_error:
  Ticket #1574: mc crashes while setting tty colors
This commit is contained in:
Andrew Borodin 2009-08-31 14:49:08 +04:00
commit 17c5c22da8

View File

@ -75,14 +75,21 @@ configure_colors_string (const char *the_color_string)
p = color_strings;
while ((p != NULL) && (*p != NULL)) {
char **cfb; /* color, fore, back*/
char **cfb; /* color, fore, back */
/* cfb[0] - entry name
* cfb[1] - fore color
* cfb[20 - back color
* cfb[2] - back color
*/
char *e;
cfb = g_strsplit_set (*p, "=,", 3);
p++;
if (cfb[0] == NULL) {
g_strfreev (cfb);
continue;
}
/* append '=' to the entry name */
e = g_strdup_printf ("%s=", cfb[0]);
g_free (cfb[0]);
@ -102,7 +109,6 @@ configure_colors_string (const char *the_color_string)
}
g_strfreev (cfb);
p++;
}
g_strfreev (color_strings);