]> Kevux Git Server - fll/commitdiff
Bugfix: IKI Read should not always print content on substitution in whole mode.
authorKevin Day <thekevinday@gmail.com>
Mon, 29 Jun 2020 04:25:14 +0000 (23:25 -0500)
committerKevin Day <thekevinday@gmail.com>
Mon, 29 Jun 2020 04:25:14 +0000 (23:25 -0500)
When printing in whole mode, it is only printing the content, even when --literal is passed.

What should happen is that when --literal is passed, the entire variable should be printed, even when substitution is used.
The substitution will still occur.

level_3/iki_read/c/private-iki_read.c

index d4210932a8f40ef5ebc1c4fac6c2c56f298f5fce..a9df7d6ad1790f613a571ea186c497204784375d 100644 (file)
@@ -402,7 +402,7 @@ extern "C" {
       return status;
     }
 
-    bool content_only = data->mode == iki_read_mode_content;
+    const bool content_only = data->mode == iki_read_mode_content;
 
     iki_read_substitutions substitutionss[variable->used];
 
@@ -516,6 +516,8 @@ extern "C" {
       return F_none;
     }
 
+    const bool content_only = data->mode == iki_read_mode_content;
+
     iki_read_substitutions substitutionss[variable->used];
 
     memset(substitutionss, 0, sizeof(iki_read_substitutions) * variable->used);
@@ -630,7 +632,7 @@ extern "C" {
           }
           else {
             if (substitutionss[j].used) {
-              iki_read_substitutions_print(*data, *variable, *content, *ranges, substitutionss[j], j, F_true);
+              iki_read_substitutions_print(*data, *variable, *content, *ranges, substitutionss[j], j, content_only);
             }
             else {
               f_print_string_dynamic_partial(f_type_output, data->buffer, ranges->array[j]);
@@ -639,7 +641,7 @@ extern "C" {
         }
         else {
           if (substitutionss[j].used) {
-            iki_read_substitutions_print(*data, *variable, *content, *ranges, substitutionss[j], j, F_true);
+            iki_read_substitutions_print(*data, *variable, *content, *ranges, substitutionss[j], j, content_only);
           }
           else {
             f_print_string_dynamic_partial(f_type_output, data->buffer, ranges->array[j]);