From 6a134551b912afdf9836ef8d89ccb8a38a222672 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Tue, 10 Jan 2023 13:32:38 -0800 Subject: [PATCH] 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 --- gtk/gtkistringprivate.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.30.2