From dc61c506153942c56bf433030339a9a9be20f22e Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 29 Feb 2024 23:03:54 -0600 Subject: [PATCH] Bugfix: If the first character has a width greater than one then F_utf_fragment is incorrectly returned when using quotes. A F_utf_fragment is incorrectly when writing a string that would use quotes and that first character has a width greater than one. The code is incrementing the string by 1. This should instead be incrementing by the character width. The loop itself should increment by the character width as well. This bug has been exposed by unit tests from the 0.7 development branch. --- level_1/fl_fss/c/private-fss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/level_1/fl_fss/c/private-fss.c b/level_1/fl_fss/c/private-fss.c index 5ee7bb6..1de3a7d 100644 --- a/level_1/fl_fss/c/private-fss.c +++ b/level_1/fl_fss/c/private-fss.c @@ -1085,7 +1085,7 @@ extern "C" { // The start quote may or may not need to be delimited in this case. if (destination->string[input_start] == quote_char) { - for (i = input_start + 1; i <= range->stop && i < object.used; ++i) { + for (i = input_start + macro_f_utf_byte_width(object.string[input_start]); i <= range->stop && i < object.used; i += macro_f_utf_byte_width(object.string[i])) { if (state.interrupt) { status = state.interrupt((void *) &state, 0); -- 1.8.3.1