aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Elliston <bje@gnu.org>2018-12-12 12:57:00 +1100
committerBen Elliston <bje@gnu.org>2018-12-12 12:57:00 +1100
commit874edd44fc41aff555b8cc39d91b6576095135df (patch)
tree9c4f48d766c74c88e275aa234eb24115ae6185d8 /lib
parentb0b842d77c6fc8b9f6c9f19baa93fb20330f5301 (diff)
downloaddejagnu-874edd44fc41aff555b8cc39d91b6576095135df.zip
dejagnu-874edd44fc41aff555b8cc39d91b6576095135df.tar.gz
dejagnu-874edd44fc41aff555b8cc39d91b6576095135df.tar.bz2
* config/gdb-comm.exp, config/gdb_stub.exp, config/vxworks.exp,
lib/dg.exp, lib/ftp.exp, lib/kermit.exp, lib/rlogin.exp, lib/telnet.exp, runtest.exp, testsuite/lib/libsup.exp: Simplify some regular expressions in constant strings by placing them inside braces instead of quotes. This allows one level of backslash quoting to be removed.
Diffstat (limited to 'lib')
-rw-r--r--lib/dg.exp4
-rw-r--r--lib/ftp.exp2
-rw-r--r--lib/kermit.exp2
-rw-r--r--lib/rlogin.exp6
-rw-r--r--lib/telnet.exp10
5 files changed, 12 insertions, 12 deletions
diff --git a/lib/dg.exp b/lib/dg.exp
index 68c63a3..8ad8fd9 100644
--- a/lib/dg.exp
+++ b/lib/dg.exp
@@ -568,7 +568,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
}
@@ -843,7 +843,7 @@ proc dg-test { args } {
# It would be a bit cumbersome though.
if {${dg-final-code} ne ""} {
- regsub -all "\\\\(\[{}\])" ${dg-final-code} "\\1" dg-final-code
+ regsub -all {\\([{}])} ${dg-final-code} {\1} dg-final-code
# Note that the use of `args' here makes this a varargs proc.
proc dg-final-proc { args } ${dg-final-code}
verbose "Running dg-final tests." 3
diff --git a/lib/ftp.exp b/lib/ftp.exp
index e1cc1a9..ad3d8e9 100644
--- a/lib/ftp.exp
+++ b/lib/ftp.exp
@@ -186,7 +186,7 @@ proc ftp_download {host localfile remotefile} {
set loop 0
set remotefile ""
}
- -re "(^|\[\r\n\])150.*connection for (.*) \[(\]\[0-9.,\]+\\)\[\r\n\]" {
+ -re {(^|[\r\n])150.*connection for (.*) [(][0-9.,]+\)[\r\n]} {
set remotefile $expect_out(2,string)
exp_continue
}
diff --git a/lib/kermit.exp b/lib/kermit.exp
index 6d06969..5630582 100644
--- a/lib/kermit.exp
+++ b/lib/kermit.exp
@@ -138,7 +138,7 @@ proc kermit_command {dest args} {
}
send -i $shell_id "c\r"
expect {
- -i $shell_id -re ".*other options.\[\r\n\]+" { }
+ -i $shell_id -re {.*other options.[\r\n]+} { }
-i $shell_id timeout {
perror "Unable to resume Kermit connection."
return -1
diff --git a/lib/rlogin.exp b/lib/rlogin.exp
index 30d2d1e..b16fcc2 100644
--- a/lib/rlogin.exp
+++ b/lib/rlogin.exp
@@ -70,7 +70,7 @@ proc rlogin_open { arg } {
set result 0
break
}
- -re "TERM = .*\\)\[ ]*$" {
+ -re {TERM = .*\)[ ]*$} {
send "dumb\r\n"
expect {
"Terminal type is*$" {
@@ -143,8 +143,8 @@ proc rlogin_spawn { dest cmdline } {
if { $shell_id ne "" && $shell_id > 0 } {
remote_send $dest "echo k\r"
remote_expect $dest 20 {
- -re "\\(gdb\\)" {
- set shell_prompt "\\(gdb\\)"
+ -re {\(gdb\)} {
+ set shell_prompt {\(gdb\)}
# gdb uses 'shell command'.
set prefix "shell "
set ok 1
diff --git a/lib/telnet.exp b/lib/telnet.exp
index 219684a..abb7db0 100644
--- a/lib/telnet.exp
+++ b/lib/telnet.exp
@@ -119,7 +119,7 @@ proc telnet_open { hostname args } {
perror "telnet: need a password"
break
}
- -re "advance.*y/n.*\\?" {
+ -re {advance.*y/n.*\?} {
exp_send "n\n"
exp_continue
}
@@ -140,7 +140,7 @@ proc telnet_open { hostname args } {
sleep 20
exp_continue
}
- -re "Escape character is.*\\.\[\r\n\]" {
+ -re {Escape character is.*\.[\r\n]} {
if { $raw || [board_info $connhost exists dont_wait_for_prompt] } {
set result 0
} else {
@@ -170,7 +170,7 @@ proc telnet_open { hostname args } {
warning "telnet: connection closed by foreign host."
break
}
- -re "\[\r\n\]+" {
+ -re {[\r\n]+} {
exp_continue
}
timeout {
@@ -227,11 +227,11 @@ proc telnet_binary { hostname } {
remote_send $hostname "toggle binary\n"
exp_continue
}
- -re "Negotiating binary.*\[\r\n\].*$" { }
+ -re {Negotiating binary.*[\r\n].*$} { }
-re "binary.*unknown argument.*telnet> *$" {
remote_send $hostname "mode character\n"
}
- -re "Already operating in binary.*\[\r\n\].*$" { }
+ -re {Already operating in binary.*[\r\n].*$} { }
timeout {
warning "Never got binary response from telnet."
}