From 23c483e13777e4fa341f553e183e0217dbac91af Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 29 Feb 2024 23:01:24 -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. --- 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 6809e6a..c07423a 100644 --- a/level_1/fl_fss/c/private-fss.c +++ b/level_1/fl_fss/c/private-fss.c @@ -1105,7 +1105,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) { state->interrupt((void *) state, internal); -- 1.8.3.1