From: Kevin Day Date: Fri, 1 Mar 2024 05:03:54 +0000 (-0600) Subject: Bugfix: If the first character has a width greater than one then F_utf_fragment is... X-Git-Tag: 0.6.9~2 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=dc61c506153942c56bf433030339a9a9be20f22e;p=fll 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. --- 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);