run: support variable arguments in append_if

This enables to use append_if like the append command in the following
situation.

  proc optional_binary {} {...}

  append_if $optional config {
    <start name="} [optional_binary] {">
    ...
  }
This commit is contained in:
Christian Helmuth 2017-03-09 11:54:05 +01:00
parent 9cd3637035
commit 62e605325e
1 changed files with 2 additions and 2 deletions

View File

@ -72,9 +72,9 @@ proc create_boot_directory { } {
##
# Append string to variable only if 'condition' is satisfied
#
proc append_if {condition var string} {
proc append_if {condition var args} {
upvar $var up_var
if {$condition} { append up_var $string }
if {$condition} { append up_var [join $args ""] }
}