From 2eab7a5ab310c267b09196585305efcd88e74b01 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Wed, 14 Dec 2022 18:14:47 -0600 Subject: [PATCH] Bugfix: The IKI variables that expand reserved words should expand into multiple parameters. Reserved words, such as the ones regarding the --mode parameter, have multiple values then these should themselves expand into multiple values. Wrapping quotes can be added to prevent this behavior. There may be previous issues that intentionally added this (and then possibly as a bugfix). The previous behavior of expanding multi-valued reserved words into a single parameter value when not using quotes is now considered a bug. --- level_3/fake/c/private-make-operate.c | 4 ++-- level_3/fake/documents/fakefile.txt | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/level_3/fake/c/private-make-operate.c b/level_3/fake/c/private-make-operate.c index ff28938..63b45d8 100644 --- a/level_3/fake/c/private-make-operate.c +++ b/level_3/fake/c/private-make-operate.c @@ -459,8 +459,8 @@ extern "C" { unmatched = F_false; separate = F_false; - // Quoted IKI Content or unquoted IKI Content that are reserved words and entirely represent a single parameter should expand into a single argument. - if (content.array[i].start == iki_data->variable.array[0].start && content.array[i].stop == iki_data->variable.array[0].stop || quotes.array[i]) { + // Quoted IKI Content entirely represent a single parameter should expand into a single argument. + if (quotes.array[i]) { // Pre-allocate memory to reduce number of allocations. l = parameter->used; diff --git a/level_3/fake/documents/fakefile.txt b/level_3/fake/documents/fakefile.txt index adc600a..6cb60b4 100644 --- a/level_3/fake/documents/fakefile.txt +++ b/level_3/fake/documents/fakefile.txt @@ -314,7 +314,7 @@ Fakefile Documentation: For example, code:"if parameter verbose silent" would test if both the code:"verbose" and the code:"silent" variables are defined via the code:"parameter" setting. Reserved parameters that represent program arguments, three forms are available. - For example, the program argument -w/--work has the reserved word code:"work" and has three forms\: + For example, the program argument code:"-w/--work" has the reserved word code:"work" and has three forms\: 1) code:"work". 2) code:"work:option". 3) code:"work:value". @@ -325,6 +325,9 @@ Fakefile Documentation: Some reserved parameters, such as the code:"verbosity", has no code:"value" and in this case would always return false for code:"if parameter verbosity:value". + Multi-valued reserved parameters expand into multiple parameters (such as when using multiple code:"-m/--mode"). + Avoid this behavior by wrapping the the bold:"IKI" variable in quotes. + The following are reserved parameters\: - code:"build": Associated with code:"-b/--build" parameter. - code:"color": Associated with code:"+d/++dark", code:"+l/++light", and code:"+n/++no_color" parameters. -- 1.8.3.1