]> Kevux Git Server - fll/commitdiff
Bugfix: delimit placeholder not being applied in all cases
authorKevin Day <thekevinday@gmail.com>
Sat, 27 Jun 2020 23:03:46 +0000 (18:03 -0500)
committerKevin Day <thekevinday@gmail.com>
Sat, 27 Jun 2020 23:03:46 +0000 (18:03 -0500)
The final exist should apply any delimits.

When determining the remaining width, make sure that the range or buffer has not yet been exceeded.
Not doing this resulted in an exit with an F_parameter error, further resulting in no delimits being applied.

level_0/f_iki/c/iki.c

index 5762e42522ab67e12fed69dba9ec77970dbf6f95..6205aaed1d5c8027f5714e16f24c77ba17825329 100644 (file)
@@ -444,6 +444,8 @@ extern "C" {
             return status;
           }
 
+          if (range->start > range->stop || range->start >= buffer->used) break;
+
           f_macro_iki_determine_width_max(buffer, range, width_max);
 
           status = f_utf_is_word_dash_plus(buffer->string + range->start, width_max);
@@ -466,6 +468,10 @@ extern "C" {
       }
     } while (range->start <= range->stop && range->start < buffer->used);
 
+    for (f_array_length i = 0; i < delimits.used; i++) {
+      buffer->string[delimits.array[i]] = f_iki_syntax_placeholder;
+    } // for
+
     f_macro_string_lengths_delete(status, delimits);
     if (F_status_is_error(status)) return status;