about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2003-07-25 10:53:44 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2003-07-25 10:53:44 +0000
commit0f080f741cb1a1402e87e6516af92601bff0fccd (patch)
tree9dfe48eaf9c2525e619c7e17dcf52373342afe4a
parentadf2c2a0b606cae3de93bc2e452edf8213cb1d4a (diff)
downloadzsh-0f080f741cb1a1402e87e6516af92601bff0fccd.tar.gz
zsh-0f080f741cb1a1402e87e6516af92601bff0fccd.tar.xz
zsh-0f080f741cb1a1402e87e6516af92601bff0fccd.zip
18908: use print/read -u in completion system and tweak builtin doc
-rw-r--r--ChangeLog7
-rw-r--r--Doc/Zsh/builtins.yo8
-rw-r--r--Functions/TCP/tcp_fd_handler4
-rw-r--r--Functions/TCP/tcp_read2
-rw-r--r--Functions/TCP/tcp_send2
-rw-r--r--Functions/TCP/tcp_sess2
6 files changed, 16 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 82e743a90..5370d0bb1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2003-07-25  Peter Stephenson  <pws@csr.com>
+
+	* 18908: Doc/Zsh/builtins.yo, Functions/TCP/tcp_fd_handler,
+	Functions/TCP/tcp_read, Functions/TCP/tcp_send,
+	Functions/TCP/tcp_sess: Use print/read -u for supplying fd's.
+	Tweak documentation for print/read -u for consistency.
+
 2003-07-24  Oliver Kiddle  <opk@zsh.org>
 
 	* 18901: baptiste daroussin (and Nikolai Weibull, 18894):
diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo
index a31e7fde6..d7f4625e4 100644
--- a/Doc/Zsh/builtins.yo
+++ b/Doc/Zsh/builtins.yo
@@ -657,7 +657,7 @@ If the tt(PUSHD_MINUS) option is set, the meanings of `tt(PLUS())' and
 `tt(-)' in this context are swapped.
 )
 findex(print)
-xitem(tt(print) [ tt(-abcDilmnNoOpPrsz) ] [ tt(-u)var(n) ] [ tt(-f) var(format) ] [ tt(-C) var(cols) ])
+xitem(tt(print) [ tt(-abcDilmnNoOpPrsz) ] [ tt(-u) var(n) ] [ tt(-f) var(format) ] [ tt(-C) var(cols) ])
 item(  [ tt(-R) [ tt(-en) ]] [ var(arg) ... ])(
 With the `tt(-f)' option the arguments are printed as described by tt(printf).
 With no flags or with the flag `tt(-)', the arguments are printed on
@@ -738,7 +738,7 @@ tt(-R); all other arguments and options are printed.
 item(tt(-s))(
 Place the results in the history list instead of on the standard output.
 )
-item(tt(-u)var(n))(
+item(tt(-u) var(n))(
 Print the arguments to file descriptor var(n).
 )
 item(tt(-z))(
@@ -827,7 +827,7 @@ alias(r)(fc -e -)
 findex(read)
 vindex(IFS, use of)
 ifzman(xitem(tt(read) [ tt(-rszpqAclneE) ] [ tt(-t) [ var(num) ] ] [ tt(-k) [ var(num) ] ] [ tt(-d) var(delim) ]))
-item(ifnzman(tt(read) [ tt(-rszpqAclneE) ] [ tt(-t) [ var(num) ] ] [ tt(-k) [ var(num) ] ] [ tt(-d) var(delim) ]) [ tt(-u)var(n) ] [ var(name)[tt(?)var(prompt)] ] [ var(name) ...  ])(
+item(ifnzman(tt(read) [ tt(-rszpqAclneE) ] [ tt(-t) [ var(num) ] ] [ tt(-k) [ var(num) ] ] [ tt(-d) var(delim) ]) [ tt(-u) var(n) ] [ var(name)[tt(?)var(prompt)] ] [ var(name) ...  ])(
 vindex(REPLY, use of)
 vindex(reply, use of)
 Read one line and break it into fields using the characters
@@ -895,7 +895,7 @@ read.  Note that the command name is word number 1, not word 0,
 and that when the cursor is at the end of the line, its character
 index is the length of the line plus one.
 )
-item(tt(-u)var(n))(
+item(tt(-u) var(n))(
 Input is read from file descriptor var(n).
 )
 item(tt(-p))(
diff --git a/Functions/TCP/tcp_fd_handler b/Functions/TCP/tcp_fd_handler
index 012fd4d87..33f553536 100644
--- a/Functions/TCP/tcp_fd_handler
+++ b/Functions/TCP/tcp_fd_handler
@@ -20,14 +20,14 @@ else
   zle -I
   # Handle fds not in the TCP set similarly.
   # This does the drain thing, to try and get as much data out as possible.
-  if ! read line <&$1; then
+  if ! read -u $1 line; then
     print "[Reading on $1 failed; removing from poll list]" >& 2
     zle -F $1
     return 1
   fi
   line="fd$1:$line"
   local newline
-  while read -t newline <&$1; do
+  while read -u $1 -t newline; do
     line="${line}
 fd$1:$newline"
   done
diff --git a/Functions/TCP/tcp_read b/Functions/TCP/tcp_read
index 51e5356cc..f70bd798c 100644
--- a/Functions/TCP/tcp_read
+++ b/Functions/TCP/tcp_read
@@ -190,7 +190,7 @@ while (( ${#read_fds} )); do
     print "[tcp_read: returned fds ${reply}]" >&2
   fi
   for read_fd in ${reply[2,-1]}; do
-    if ! read -r line <&$read_fd; then
+    if ! read -u $read_fd -r line; then
       unset "read_fds[$read_fd]"
       stat=1
       continue
diff --git a/Functions/TCP/tcp_send b/Functions/TCP/tcp_send
index c5f902f71..c6d8ad637 100644
--- a/Functions/TCP/tcp_send
+++ b/Functions/TCP/tcp_send
@@ -62,7 +62,7 @@ for TCP_SESS in $sessions; do
 	mystat=1
 	continue
     fi
-    print $nonewline -r -- $* >&$fd
+    print -u $fd $nonewline -r -- $*
     if [[ $? -ne 0 || -n $TCP_FD_CLOSED ]]; then
 	print "Session ${TCP_SESS}: fd $fd unusable." >&2
 	unset TCP_FD_CLOSED
diff --git a/Functions/TCP/tcp_sess b/Functions/TCP/tcp_sess
index ee3d268b3..a07c33a03 100644
--- a/Functions/TCP/tcp_sess
+++ b/Functions/TCP/tcp_sess
@@ -33,7 +33,7 @@ for name in ${(ko)tcp_by_name}; do
   else
     cur=
   fi
-  print "sess:$name; fd:$fd$cur" >&$__myfd
+  print -u $__myfd "sess:$name; fd:$fd$cur"
 done
 
 return $(( __myfd - 1 ))