1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-13 13:41:01 +02:00

18908: use print/read -u in completion system and tweak builtin doc

This commit is contained in:
Peter Stephenson 2003-07-25 10:53:44 +00:00
parent adf2c2a0b6
commit 0f080f741c
6 changed files with 16 additions and 9 deletions

View file

@ -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> 2003-07-24 Oliver Kiddle <opk@zsh.org>
* 18901: baptiste daroussin (and Nikolai Weibull, 18894): * 18901: baptiste daroussin (and Nikolai Weibull, 18894):

View file

@ -20,14 +20,14 @@ else
zle -I zle -I
# Handle fds not in the TCP set similarly. # Handle fds not in the TCP set similarly.
# This does the drain thing, to try and get as much data out as possible. # 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 print "[Reading on $1 failed; removing from poll list]" >& 2
zle -F $1 zle -F $1
return 1 return 1
fi fi
line="fd$1:$line" line="fd$1:$line"
local newline local newline
while read -t newline <&$1; do while read -u $1 -t newline; do
line="${line} line="${line}
fd$1:$newline" fd$1:$newline"
done done

View file

@ -190,7 +190,7 @@ while (( ${#read_fds} )); do
print "[tcp_read: returned fds ${reply}]" >&2 print "[tcp_read: returned fds ${reply}]" >&2
fi fi
for read_fd in ${reply[2,-1]}; do 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]" unset "read_fds[$read_fd]"
stat=1 stat=1
continue continue

View file

@ -62,7 +62,7 @@ for TCP_SESS in $sessions; do
mystat=1 mystat=1
continue continue
fi fi
print $nonewline -r -- $* >&$fd print -u $fd $nonewline -r -- $*
if [[ $? -ne 0 || -n $TCP_FD_CLOSED ]]; then if [[ $? -ne 0 || -n $TCP_FD_CLOSED ]]; then
print "Session ${TCP_SESS}: fd $fd unusable." >&2 print "Session ${TCP_SESS}: fd $fd unusable." >&2
unset TCP_FD_CLOSED unset TCP_FD_CLOSED

View file

@ -33,7 +33,7 @@ for name in ${(ko)tcp_by_name}; do
else else
cur= cur=
fi fi
print "sess:$name; fd:$fd$cur" >&$__myfd print -u $__myfd "sess:$name; fd:$fd$cur"
done done
return $(( __myfd - 1 )) return $(( __myfd - 1 ))