aboutsummaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorBen Elliston <bje@gnu.org>2016-03-29 10:52:29 +1100
committerBen Elliston <bje@gnu.org>2016-03-29 10:52:29 +1100
commit85e283265453b698f1f5a22b2eeedc0c05aafe91 (patch)
tree9e9a52b78d6078cc5cd9512699015d42f016d5d4 /config
parent569f8718b534a2cd9511a7d640352eb0126ff492 (diff)
downloaddejagnu-85e283265453b698f1f5a22b2eeedc0c05aafe91.zip
dejagnu-85e283265453b698f1f5a22b2eeedc0c05aafe91.tar.gz
dejagnu-85e283265453b698f1f5a22b2eeedc0c05aafe91.tar.bz2
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 '-'.
Diffstat (limited to 'config')
-rw-r--r--config/adb.exp8
-rw-r--r--config/vxworks.exp4
2 files changed, 6 insertions, 6 deletions
diff --git a/config/adb.exp b/config/adb.exp
index b5e5d6c..4326fa4 100644
--- a/config/adb.exp
+++ b/config/adb.exp
@@ -43,13 +43,13 @@ proc adb_open { hostname } {
set tries 0
set result -1
- if [board_info ${hostname} exists shell_prompt] {
+ if {[board_info ${hostname} exists shell_prompt]} {
set shell_prompt [board_info ${hostname} shell_prompt]
} else {
set shell_prompt "root@android:/ # "
}
- if [board_info $hostname exists fileid] {
+ if {[board_info $hostname exists fileid]} {
unset board_info($hostname,fileid)
}
@@ -116,7 +116,7 @@ proc adb_download {desthost srcfile destfile} {
proc adb_file {dest op args} {
set file [lindex $args 0]
verbose "Executing command: $op $args" 2
- switch $op {
+ switch -- $op {
exists {
set status [catch "exec adb [adb_serial] shell ls |& cat" out]
}
@@ -185,5 +185,5 @@ proc adb_exec { boardname cmd args } {
# Delete one trailing \n because that is what `exec' will do and we want
# to behave identical to it.
regsub "\n$" $output "" output
- return [list [expr $status != 0] $output]
+ return [list [expr {$status != 0}] $output]
}
diff --git a/config/vxworks.exp b/config/vxworks.exp
index 05f8810..f93ea3b 100644
--- a/config/vxworks.exp
+++ b/config/vxworks.exp
@@ -179,7 +179,7 @@ proc vxworks_file { dest op args } {
set file [lindex $args 0]
if {[board_info $dest exists vxworks_homedir]} {
set dir "[board_info $dest vxworks_homedir]"
- switch $op {
+ switch -- $op {
exists {
set file "${dir}/[file tail $file]"
return [file exists $file]
@@ -191,7 +191,7 @@ proc vxworks_file { dest op args } {
file delete -force -- $x
}
}
- return
+ return {}
}
}
}