+2005-05-15 Mark Mitchell <mark@codesourcery.com>
+
+ * lib/compat.exp (compat-execute): Do not use regsub unsafely.
+
2005-05-15 Jerry DeLisle <jvdelisle@verizon.net>
PR fortran/17432
regsub "sid" "sid_y_alt.o" $sid obj3_alt
# Get the base name of this test, for use in messages.
- regsub "^$srcdir/?" $src1 "" testcase
- regsub "^$tmpdir/?" $testcase "tmpdir-" testcase
+ set testcase "$src1"
+ # Remove the $srcdir and $tmpdir prefixes from $src1. (It would
+ # be possible to use "regsub" here, if we were careful to escape
+ # all regular expression characters in $srcdir and $tmpdir, but
+ # that would be more complicated that this approach.)
+ if {[string first "$srcdir/" "$src1"] == 0} {
+ set testcase [string range "$src1" [string length "$srcdir/"] end]
+ }
+ if {[string first "$tmpdir/" "$src1"] == 0} {
+ set testcase [string range "$src1" [string length "$tmpdir/"] end]
+ }
regsub "_main.*" $testcase "" testcase
# Set up the base name of executable files so they'll be unique.
regsub -all "\[./\]" $testcase "-" execbase