all repos — tint2 @ 95d4d90efd1164432ed6f98ea9aa09fcc4c6fa9b

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

Button: fix parsing of empty config options
o9000 mrovi9000@gmail.com
commit

95d4d90efd1164432ed6f98ea9aa09fcc4c6fa9b

parent

6605a1c3c286d0eec6f8a3971931fc58cccb3c36

1 files changed, 17 insertions(+), 11 deletions(-)

jump to
M src/config.csrc/config.c

@@ -779,17 +779,23 @@

/* Button */ else if (strcmp(key, "button") == 0) { panel_config.button_list = g_list_append(panel_config.button_list, create_button()); - } else if (strcmp(key, "button_icon") == 0 && strlen(value)) { - Button *button = get_or_create_last_button(); - button->backend->icon_name = strdup(value); - } else if (strcmp(key, "button_text") == 0 && strlen(value)) { - Button *button = get_or_create_last_button(); - free_and_null(button->backend->text); - button->backend->text = strdup(value); - } else if (strcmp(key, "button_tooltip") == 0 && strlen(value)) { - Button *button = get_or_create_last_button(); - free_and_null(button->backend->tooltip); - button->backend->tooltip = strdup(value); + } else if (strcmp(key, "button_icon") == 0) { + if (strlen(value)) { + Button *button = get_or_create_last_button(); + button->backend->icon_name = strdup(value); + } + } else if (strcmp(key, "button_text") == 0) { + if (strlen(value)) { + Button *button = get_or_create_last_button(); + free_and_null(button->backend->text); + button->backend->text = strdup(value); + } + } else if (strcmp(key, "button_tooltip") == 0) { + if (strlen(value)) { + Button *button = get_or_create_last_button(); + free_and_null(button->backend->tooltip); + button->backend->tooltip = strdup(value); + } } else if (strcmp(key, "button_font") == 0) { Button *button = get_or_create_last_button(); pango_font_description_free(button->backend->font_desc);