]> Kevux Git Server - fll/commitdiff
Progress: Fix additional problems in iki_read.
authorKevin Day <thekevinday@gmail.com>
Sun, 23 Oct 2022 21:22:30 +0000 (16:22 -0500)
committerKevin Day <thekevinday@gmail.com>
Sun, 23 Oct 2022 21:28:32 +0000 (16:28 -0500)
This is a follow up to bcaeef117bede5037b0404ebf299446dd1be3fcc.

The substitute is not completely updated to also process the --literal parameter.

Should be using f_console_symbol_long_enable_s instead of f_console_symbol_short_enable_s when printing errors.

level_3/iki_read/c/common.c
level_3/iki_read/c/private-print.c

index a2249f55376a568748b97d0283c0933d70234ca4..7234fe2547a032c55e0a675d27d0326b1e8542a4 100644 (file)
@@ -279,7 +279,7 @@ extern "C" {
       setting->status = F_status_set_error(F_parameter);
 
       iki_read_print_line_first_locked(setting, main->error);
-      fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_short_enable_s, iki_read_long_name_s);
+      fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_enable_s, iki_read_long_name_s);
       iki_read_print_line_last_locked(setting, main->error);
 
       return;
@@ -290,7 +290,7 @@ extern "C" {
         setting->status = F_status_set_error(F_parameter);
 
         iki_read_print_line_first_locked(setting, main->error);
-        fll_program_print_error_parameter_missing_value_requires_amount(main->error, f_console_symbol_short_enable_s, iki_read_long_replace_s, iki_read_string_two_s);
+        fll_program_print_error_parameter_missing_value_requires_amount(main->error, f_console_symbol_long_enable_s, iki_read_long_replace_s, iki_read_string_two_s);
         iki_read_print_line_last_locked(setting, main->error);
 
         return;
@@ -367,7 +367,7 @@ extern "C" {
         setting->status = F_status_set_error(F_parameter);
 
         iki_read_print_line_first_locked(setting, main->error);
-        fll_program_print_error_parameter_missing_value_requires_amount(main->error, f_console_symbol_short_enable_s, iki_read_long_substitute_s, iki_read_string_three_s);
+        fll_program_print_error_parameter_missing_value_requires_amount(main->error, f_console_symbol_long_enable_s, iki_read_long_substitute_s, iki_read_string_three_s);
         iki_read_print_line_last_locked(setting, main->error);
 
         return;
@@ -456,7 +456,7 @@ extern "C" {
         setting->status = F_status_set_error(F_parameter);
 
         iki_read_print_line_first_locked(setting, main->error);
-        fll_program_print_error_parameter_missing_value_requires_amount(main->error, f_console_symbol_short_enable_s, iki_read_long_wrap_s, iki_read_string_three_s);
+        fll_program_print_error_parameter_missing_value_requires_amount(main->error, f_console_symbol_long_enable_s, iki_read_long_wrap_s, iki_read_string_three_s);
         iki_read_print_line_last_locked(setting, main->error);
 
         return;
index 7fb1dfa6ef90c0b7c234365155d668971670e9f7..96a95e0509cf35aff80e862f515df146cf4ed50d 100644 (file)
@@ -17,15 +17,29 @@ extern "C" {
     }
 
     if (at < setting->substitute.used) {
-      if (!(setting->flag & iki_read_main_flag_content_e)) {
-        f_print_dynamic(setting->substitute.array[at].a, main->output.to);
+      if (setting->flag & iki_read_main_flag_content_e) {
+        iki_read_print_wrap_prepend(main, setting, index);
+
+        f_print_dynamic(setting->substitute.array[at].c, main->output.to);
+
+        iki_read_print_wrap_append(main, setting, index);
       }
+      else {
+        f_string_range_t range = macro_f_string_range_t_initialize(setting->data.variable.array[index].start, setting->data.content.array[index].start - 1);
 
-      iki_read_print_wrap_prepend(main, setting, index);
+        f_print_dynamic_partial(setting->buffer, range, main->output.to);
 
-      f_print_dynamic(setting->substitute.array[at].c, main->output.to);
+        iki_read_print_wrap_prepend(main, setting, index);
 
-      iki_read_print_wrap_append(main, setting, index);
+        f_print_dynamic(setting->substitute.array[at].c, main->output.to);
+
+        iki_read_print_wrap_append(main, setting, index);
+
+        range.start = setting->data.content.array[index].stop + 1;
+        range.stop = setting->data.variable.array[index].stop;
+
+        f_print_dynamic_partial(setting->buffer, range, main->output.to);
+      }
     }
     else if (setting->replace.used && setting->map_replaces[index] < setting->replace.used) {
       if (setting->flag & iki_read_main_flag_content_e) {