From 85e283265453b698f1f5a22b2eeedc0c05aafe91 Mon Sep 17 00:00:00 2001 From: Ben Elliston Date: Tue, 29 Mar 2016 10:52:29 +1100 Subject: More fixes identified by the Frink static analyser: (1) use -- in switch commands for safety, (2) add braces around exprs, (3) replace abbreviated "info proc" with "info procs", (4) use -- in regexp commands for safety where the expression is a variable that could begin with '-'. --- lib/dg.exp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/dg.exp') diff --git a/lib/dg.exp b/lib/dg.exp index 6a54b46..ab5816d 100644 --- a/lib/dg.exp +++ b/lib/dg.exp @@ -569,7 +569,7 @@ proc dg-runtest { testcases options default-extra-options } { # proc dg-trim-dirname { dir_name file_name } { set special_character "\[\?\+\-\.\(\)\$\|\]" - regsub -all $special_character $dir_name "\\\\&" dir_name + regsub -all -- $special_character $dir_name "\\\\&" dir_name regsub "^$dir_name/?" $file_name "" file_name return $file_name } @@ -587,7 +587,7 @@ proc dg-test { args } { global dg-do-what-default dg-interpreter-batch-mode dg-linenum-format global errorCode errorInfo global tool - global srcdir ;# eg: /calvin/dje/build/gcc/./testsuite/ + global srcdir global host_triplet target_triplet set keep 0 -- cgit v1.1