From 53fde9b0b55f763693da5acd75a56fd6d8d26bde Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sun, 28 Jun 2020 23:25:14 -0500 Subject: [PATCH] Bugfix: IKI Read should not always print content on substitution in whole mode. 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 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/level_3/iki_read/c/private-iki_read.c b/level_3/iki_read/c/private-iki_read.c index d421093..a9df7d6 100644 --- a/level_3/iki_read/c/private-iki_read.c +++ b/level_3/iki_read/c/private-iki_read.c @@ -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]); -- 1.8.3.1