diff options
author | Petr Machata <pmachata@redhat.com> | 2013-11-06 12:10:18 +0100 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-08-22 20:38:23 +0900 |
commit | 5edb66dfcbba091abc99e8d925141fe507322e83 (patch) | |
tree | 4141c9ec95f2ecb76f3ad4acc7cb886502f6e729 | |
parent | 23040c1b38cbc4488dd1c9877b3195b43c6fd0e0 (diff) | |
download | ltrace-5edb66dfcbba091abc99e8d925141fe507322e83.tar.gz ltrace-5edb66dfcbba091abc99e8d925141fe507322e83.tar.bz2 ltrace-5edb66dfcbba091abc99e8d925141fe507322e83.zip |
Support pre-8.5 TCL's by providing our own lreverse in ltrace.exp
-rw-r--r-- | testsuite/lib/ltrace.exp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/testsuite/lib/ltrace.exp b/testsuite/lib/ltrace.exp index 494b3c8..abb32f6 100644 --- a/testsuite/lib/ltrace.exp +++ b/testsuite/lib/ltrace.exp @@ -38,6 +38,18 @@ set LTRACE_OPTIONS {} set LTRACE_ARGS {} set LTRACE_TEMP_FILES {} +# Pre-8.5 TCL doesn't have lreverse. The following is taken from: +# http://www2.tcl.tk/17188 + +if {[info command lreverse] == ""} { + proc lreverse l { + set r {} + set i [llength $l] + while {[incr i -1]} {lappend r [lindex $l $i]} + lappend r [lindex $l 0] + } +} + # ltrace_compile SOURCE DEST TYPE OPTIONS # # Compile PUT(program under test) by native compiler. ltrace_compile runs |