From: Christian Hergert Date: Tue, 10 Jan 2023 21:32:38 +0000 (-0800) Subject: istring: fix istring_prepend() on malloc transition X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~8^2~75^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=6a134551b912afdf9836ef8d89ccb8a38a222672;p=gtk4.git istring: fix istring_prepend() on malloc transition When transitioning from internal to malloc, the strings were placed in the wrong order to g_strconcat(). This fixes an issue with undo where if you hit the boundary in just the right way, your undo stack will do unexpected things. Fixes #5506 --- diff --git a/gtk/gtkistringprivate.h b/gtk/gtkistringprivate.h index 9dfe8712f4..8c64261771 100644 --- a/gtk/gtkistringprivate.h +++ b/gtk/gtkistringprivate.h @@ -133,7 +133,7 @@ istring_prepend (IString *str, if (!istring_is_inline (str)) old = str->u.str; - str->u.str = g_strconcat (istring_str (str), istring_str (other), NULL); + str->u.str = g_strconcat (istring_str (other), istring_str (str), NULL); str->n_bytes += other->n_bytes; str->n_chars += other->n_chars;