diff options
author | Martin Storsjö <martin@martin.st> | 2013-04-03 15:52:45 +0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2013-05-02 22:31:55 +0300 |
commit | 4d810ad2e943a59658ddf00a397121c2b62f7157 (patch) | |
tree | 20f7f5ba00036c187e7969d63aeadb7b2c282971 /configure | |
parent | 13f57a4d881ec669b87bf82f424bfff502433060 (diff) | |
download | ffmpeg-4d810ad2e943a59658ddf00a397121c2b62f7157.tar.gz |
configure: Use a different variable name in push/popvar
The variable name 'var' is commonly used to iterate through arguments
in other functions. When the pushvar function internally uses the
variable 'var', it makes pushing/popping the variable 'var' not
work as intended.
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -424,21 +424,21 @@ get_safe(){ } pushvar(){ - for var in $*; do - eval level=\${${var}_level:=0} - eval ${var}_${level}="\$$var" - eval ${var}_level=$(($level+1)) + for pvar in $*; do + eval level=\${${pvar}_level:=0} + eval ${pvar}_${level}="\$$pvar" + eval ${pvar}_level=$(($level+1)) done } popvar(){ - for var in $*; do - eval level=\${${var}_level:-0} + for pvar in $*; do + eval level=\${${pvar}_level:-0} test $level = 0 && continue eval level=$(($level-1)) - eval $var="\${${var}_${level}}" - eval ${var}_level=$level - eval unset ${var}_${level} + eval $pvar="\${${pvar}_${level}}" + eval ${pvar}_level=$level + eval unset ${pvar}_${level} done } |