diff options
author | Ben Elliston <bje@gnu.org> | 2016-03-29 10:52:29 +1100 |
---|---|---|
committer | Ben Elliston <bje@gnu.org> | 2016-03-29 10:52:29 +1100 |
commit | 85e283265453b698f1f5a22b2eeedc0c05aafe91 (patch) | |
tree | 9e9a52b78d6078cc5cd9512699015d42f016d5d4 /config/adb.exp | |
parent | 569f8718b534a2cd9511a7d640352eb0126ff492 (diff) | |
download | dejagnu-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/adb.exp')
-rw-r--r-- | config/adb.exp | 8 |
1 files changed, 4 insertions, 4 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] } |