gnucash stable: Fix lockup on Windows in completioncell

Robert Fewell bobit at code.gnucash.org
Tue Jun 13 10:52:37 EDT 2023


Updated	 via  https://github.com/Gnucash/gnucash/commit/853791cb (commit)
	from  https://github.com/Gnucash/gnucash/commit/38118a2a (commit)



commit 853791cbf7dc9354647c74353beec40f2ea55b66
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Tue Jun 13 15:48:59 2023 +0100

    Fix lockup on Windows in completioncell
    
    Missed updating an 'if' clause which resulted in a negative offset for
    previous character.

diff --git a/gnucash/register/register-gnome/completioncell-gnome.c b/gnucash/register/register-gnome/completioncell-gnome.c
index 3fdf827f06..c4bc0aaceb 100644
--- a/gnucash/register/register-gnome/completioncell-gnome.c
+++ b/gnucash/register/register-gnome/completioncell-gnome.c
@@ -494,7 +494,7 @@ test_and_add (PopBox* box, const gchar *text, gint start_pos,
 
         match = g_utf8_substring (text, found_location, found_location + newval_length);
 
-        if (found_location >= 1)
+        if (found_location - start_pos >= 1)
         {
             gunichar prev = g_utf8_get_char (g_utf8_offset_to_pointer (sub_text, found_location - start_pos - 1));
             if (prev && (g_unichar_isspace (prev) || g_unichar_ispunct (prev)))



Summary of changes:
 gnucash/register/register-gnome/completioncell-gnome.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



More information about the gnucash-changes mailing list