From c050cbe9b41307e5586e9c28001d5b15c2a16327 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 1 Feb 2013 16:01:02 +0100 Subject: [PATCH] * lib/gcc-dg.exp (restore-target-env-var): Avoid using lreverse. From-SVN: r195666 --- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/lib/gcc-dg.exp | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cbc7cb1..0c01f68 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2013-02-01 Jakub Jelinek + + * lib/gcc-dg.exp (restore-target-env-var): Avoid using lreverse. + 2013-02-01 David Edelsohn * gcc.dg/pr56023.c: XFAIL on AIX. diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index b4d50cd..3a612a5 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -305,7 +305,9 @@ proc set-target-env-var { } { proc restore-target-env-var { } { upvar 1 saved_target_env_var saved_target_env_var - foreach env_var [lreverse $saved_target_env_var] { + for { set env_vari [llength $saved_target_env_var] } { + [incr env_vari -1] >= 0 } {} { + set env_var [lindex $saved_target_env_var $env_vari] set var [lindex $env_var 0] if [lindex $env_var 1] { setenv $var [lindex $env_var 2] -- 2.7.4