]> Kevux Git Server - fll/commitdiff
Bugfix: IKI read is not identifying cases with leading characters.
authorKevin Day <thekevinday@gmail.com>
Mon, 20 Jul 2020 04:06:16 +0000 (23:06 -0500)
committerKevin Day <thekevinday@gmail.com>
Mon, 20 Jul 2020 04:06:16 +0000 (23:06 -0500)
An IKI read string that begins with text that is potentially valid, followed by non-IKI name characters, and finally followed by a valid IKI variable name is not detected.

Example:
  Should=define:"value".

The above didn't resolve, but with this fix should now find the full IKI variable: 'define:"value"'.

level_0/f_iki/c/iki.c

index ec5708bd34a2a056aef33b525c2cd82dfbba702d..96c7cae02d9bb953ae14d660d8cdb5fd671dac29 100644 (file)
@@ -152,7 +152,25 @@ extern "C" {
             return status;
           }
 
-          if (status == F_false) break;
+          // current word-dash-plus block is not a valid variable name, try again.
+          if (status == F_false) {
+            f_macro_iki_seek_word_dash_plus(status, buffer, range, width_max, F_true);
+
+            if (F_status_is_error(status)) {
+              f_macro_string_lengths_delete(status, delimits);
+              return status;
+            }
+            else if (range->start > range->stop) {
+              f_macro_string_lengths_delete(status, delimits);
+              return F_data_not_stop;
+            }
+            else if (range->start >= buffer->used) {
+              f_macro_string_lengths_delete(status, delimits);
+              return F_data_not_eos;
+            }
+
+            found_vocabulary.start = range->start;
+          }
         }
 
         status = f_utf_buffer_increment(*buffer, range, 1);