Bugfix: IKI variable substitution in fake doesn't always expand properly.
The commit
85738c3aed3949cc3f26b33e39d28b69dcc6d571 didn't fully solve the problem.
One problem is a copy & paste mistake in the declaration of fake_make_parameter_variable_option_build_s where the wrong define is used.
Make sure to conditionally allocate the arguments array before operating on the "used" position.
The used_content variable should not be needed because the arguments.used should be 0.
After conditional allocation, ensure that the arguments.used is 0 before operation and remove the no longer needed used_content.
When the reserved IKI variables that represent program parameters are used and exist in isolation for their argument, then they should expand as separate variables.
Consider these four examples:
print 1 parameter:"build"
print 2 parameter:"build".
print 3 "parameter:"build""
print 4 "parameter:"build\" between parameter:"build""
Lets say fake is called with the following "fake make -b /tmp/".
The "print 1" example would have the following parameters:
1) 1
2) -b
3) /tmp/
The "print 2" example would have the following parameters:
1) 2
2) -b /tmp/.
The "print 3" example would have the following parameters:
1) 3
2) -b /tmp/
The "print 4" example would have the following parameters:
1) 3
2) -b /tmp/ between -b /tmp/
The "print 1" expands into 3 parameters because the IKI variable is by itself for that given argument.
The "print 2" expands into 2 parameters because the IKI variable is not by itself for the given argument (It has a period '.' at the end).
The "print 3" expands into 2 parameters because it is quoted and is treated as a single argument.
The "print 4" expands into 2 parameters because it is quoted and is treated as a single argument and the "between" should still be between the two substitutions.
A break is added at the end of one of the loops because that part of the loop is only reached after a match.
When a match is identified, the loop no longer needs further iterations.