about summary refs log tree commit diff
path: root/Functions/TCP/tcp_expect
diff options
context:
space:
mode:
Diffstat (limited to 'Functions/TCP/tcp_expect')
-rw-r--r--Functions/TCP/tcp_expect8
1 files changed, 6 insertions, 2 deletions
diff --git a/Functions/TCP/tcp_expect b/Functions/TCP/tcp_expect
index 14963a3e6..e49f93804 100644
--- a/Functions/TCP/tcp_expect
+++ b/Functions/TCP/tcp_expect
@@ -37,8 +37,12 @@
 emulate -L zsh
 setopt extendedglob
 
-# Get extra accuracy by making SECONDS floating point locally
-typeset -F SECONDS
+if [[ ${(t)SECONDS} != float* ]]; then
+    # If called from another function, use that
+    typeset -F TCP_SECONDS_START=$SECONDS
+    # Get extra accuracy by making SECONDS floating point locally
+    typeset -F SECONDS
+fi
 
 # Variables are all named _expect_* to avoid problems with the -p param.
 local _expect_opt _expect_pvar