about summary refs log tree commit diff
path: root/Functions
diff options
context:
space:
mode:
Diffstat (limited to 'Functions')
-rw-r--r--Functions/TCP/tcp_expect1
-rw-r--r--Functions/TCP/tcp_open2
-rw-r--r--Functions/TCP/tcp_read4
3 files changed, 5 insertions, 2 deletions
diff --git a/Functions/TCP/tcp_expect b/Functions/TCP/tcp_expect
index e49f93804..1c63b8def 100644
--- a/Functions/TCP/tcp_expect
+++ b/Functions/TCP/tcp_expect
@@ -84,6 +84,7 @@ while getopts "al:p:qs:t:T:" _expect_opt; do
 done
 (( OPTIND > 1 )) && shift $(( OPTIND - 1 ))
 
+typeset -ga tcp_expect_lines
 tcp_expect_lines=()
 while true; do
   if (( _expect_to_all || _expect_to1 )); then
diff --git a/Functions/TCP/tcp_open b/Functions/TCP/tcp_open
index 1f7a65c9a..cd1afed28 100644
--- a/Functions/TCP/tcp_open
+++ b/Functions/TCP/tcp_open
@@ -200,7 +200,7 @@ done
 
 if [[ -z $TCP_SESS ]]; then
     [[ -z $quiet ]] && print "Setting default TCP session $sessnames[1]"
-    TCP_SESS=$sessnames[1]
+    typeset -g TCP_SESS=$sessnames[1]
 fi
 
 return $stat
diff --git a/Functions/TCP/tcp_read b/Functions/TCP/tcp_read
index cf1b99441..aa30b723d 100644
--- a/Functions/TCP/tcp_read
+++ b/Functions/TCP/tcp_read
@@ -135,7 +135,9 @@ elif (( ! $#read_fds )); then
   read_fds[$tcp_by_name[$TCP_SESS]]=1
 fi
 
+typeset -ga tcp_lines
 tcp_lines=()
+
 local helper_stat=2 skip tpat reply REPLY
 float newtimeout
 
@@ -217,7 +219,7 @@ while (( ${#read_fds} )); do
         $noprint "$line"
     # REPLY is now set to the line with an appropriate prompt.
     tcp_lines+=($REPLY)
-    TCP_LINE=$REPLY TCP_LINE_FD=$read_fd
+    typeset -g TCP_LINE="$REPLY" TCP_LINE_FD="$read_fd"
 
     # Only handle one line from one device at a time unless draining.
     [[ -z $drain ]] && return $stat