From: Kevin Day Date: Thu, 15 Dec 2022 00:14:47 +0000 (-0600) Subject: Bugfix: The IKI variables that expand reserved words should expand into multiple... X-Git-Tag: 0.6.2~10 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=d329fd6c0a630c217df70594e10d3bb72421f47e;p=fll 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. --- diff --git a/level_3/fake/c/private-make-operate.c b/level_3/fake/c/private-make-operate.c index 2954ec6..c955eec 100644 --- a/level_3/fake/c/private-make-operate.c +++ b/level_3/fake/c/private-make-operate.c @@ -458,8 +458,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 57a6874..582093b 100644 --- a/level_3/fake/documents/fakefile.txt +++ b/level_3/fake/documents/fakefile.txt @@ -316,7 +316,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". @@ -327,6 +327,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.