From e436b94df7f1c049da05a1bda0a65c83bc143759 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Thu, 30 Nov 2023 13:37:00 -0500 Subject: [PATCH 1/2] label: Fix uncrustify spacing error in label --- src/libply-splash-graphics/ply-label.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libply-splash-graphics/ply-label.c b/src/libply-splash-graphics/ply-label.c index 581dbff5..bac5947f 100644 --- a/src/libply-splash-graphics/ply-label.c +++ b/src/libply-splash-graphics/ply-label.c @@ -100,7 +100,7 @@ ply_label_load_plugin (ply_label_t *label) /* ...and the FreeType based one after that, it is not a complete substitute (yet). */ if (label->module_handle == NULL) - label->module_handle = ply_open_module (PLYMOUTH_PLUGIN_PATH "label-freetype.so"); + label->module_handle = ply_open_module (PLYMOUTH_PLUGIN_PATH "label-freetype.so"); if (label->module_handle == NULL) return false; From 42d07913a0b72b8607190ab31931d5460765f589 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Sat, 25 Nov 2023 22:44:49 -0500 Subject: [PATCH 2/2] label-pango: Handle NULL text better --- src/plugins/controls/label-pango/plugin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/controls/label-pango/plugin.c b/src/plugins/controls/label-pango/plugin.c index 3fdc4ba7..d53da97c 100644 --- a/src/plugins/controls/label-pango/plugin.c +++ b/src/plugins/controls/label-pango/plugin.c @@ -188,7 +188,7 @@ init_pango_text_layout (cairo_t *cairo_context, if (width >= 0) pango_layout_set_width (pango_layout, width * PANGO_SCALE); - pango_layout_set_text (pango_layout, text, -1); + pango_layout_set_text (pango_layout, text ?: "", -1); pango_cairo_update_layout (cairo_context, pango_layout); return pango_layout; @@ -321,7 +321,7 @@ set_text_for_control (ply_label_plugin_control_t *label, { ply_rectangle_t dirty_area; - if (label->text != text) { + if (strcmp (label->text ?: "", text ?: "") != 0) { dirty_area = label->area; free (label->text); label->text = strdup (text);