From fa39098c2c012096709dce82344b90cf292e4e18 Mon Sep 17 00:00:00 2001 From: speedie Date: Fri, 28 Jul 2023 23:53:59 +0200 Subject: [PATCH] Fix segmentation fault when images --- libs/draw.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/draw.c b/libs/draw.c index 75d3332..6da0683 100644 --- a/libs/draw.c +++ b/libs/draw.c @@ -490,7 +490,11 @@ int drawinput(int x, int y, int w) { draw_text(draw, x, y, w, sp.bh, sp.lrpad / 2, isrtl ? fribidi_text : ptext, 0, pango_input ? True : False, col_inputfg, col_inputbg, alpha_inputfg, alpha_inputbg); curpos = TEXTW(ptext) - TEXTW(&ptext[sp.cursor]); - } else if (!hidepretext && pretext != NULL) { + } else { + if (hidepretext) { + pretext = ""; + } + apply_fribidi(pretext); draw_text(draw, x + fw, y, w, sp.bh, sp.lrpad / 2, isrtl ? fribidi_text : pretext, 0, pango_pretext ? True : False, col_pretextfg, col_pretextbg, alpha_pretextfg, alpha_pretextbg); }