mirror of
https://github.com/labwc/labwc.git
synced 2026-04-07 08:21:20 -04:00
Free a wasted allocation in parser
This commit is contained in:
parent
44a0da2e7f
commit
40208c57f1
1 changed files with 9 additions and 5 deletions
14
src/theme.c
14
src/theme.c
|
|
@ -452,11 +452,15 @@ parse_hexstrs(const char *hexes, float colors[3][4])
|
||||||
|
|
||||||
static enum border_type parse_border_type(const char *str) {
|
static enum border_type parse_border_type(const char *str) {
|
||||||
char *lower = g_ascii_strdown(str, -1);
|
char *lower = g_ascii_strdown(str, -1);
|
||||||
if (strstr(lower, "doublesunken")) return BORDER_DOUBLE_INSET;
|
enum border_type border_type;
|
||||||
if (strstr(lower, "sunken")) return BORDER_INSET;
|
if (strstr(lower, "doublesunken")) border_type = BORDER_DOUBLE_INSET;
|
||||||
if (strstr(lower, "doubleraised")) return BORDER_DOUBLE;
|
else if (strstr(lower, "sunken")) border_type = BORDER_INSET;
|
||||||
if (strstr(lower, "raised")) return BORDER_SINGLE;
|
else if (strstr(lower, "doubleraised")) border_type = BORDER_DOUBLE;
|
||||||
return BORDER_FLAT;
|
else if (strstr(lower, "raised")) border_type = BORDER_SINGLE;
|
||||||
|
else border_type = BORDER_FLAT;
|
||||||
|
|
||||||
|
g_free(lower);
|
||||||
|
return border_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue