Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: _next_label losing empty arguments
- X-seq: zsh-workers 11517
- From: Oliver Kiddle <opk@xxxxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxxxxxxxxx>
- Subject: PATCH: _next_label losing empty arguments
- Date: Mon, 22 May 2000 19:12:34 +0100
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Firstly, thanks Bart for the _arguments fix - that solved my problem.
I was just looking at putting the "$@"s back in to _urls on the
_next_label lines and things were not working as I hoped. The problem
occurred where I used a -S '' because _next_labels was losing the ''
argument when sticking them in the expl array.
Is the use of set in this patch instead of eval safe? I tried to answer
this myself and the following behaviour doesn't seem right:
> set -A a - 1 2 3
> echo $#a
4
> echo $a[1]
Surely, a[1] should not be empty: it should either be '-' or we should
use the ksh behaviour (the array would contain just 1,2 and 3).
Oliver
Index: Completion/Core/_next_label
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/_next_label,v
retrieving revision 1.2
diff -u -r1.2 _next_label
--- Completion/Core/_next_label 2000/04/11 07:57:57 1.2
+++ Completion/Core/_next_label 2000/05/22 18:11:31
@@ -13,10 +13,10 @@
zformat -f descr "${curtag#*:}" "d:$3"
_description "$gopt" "${curtag%:*}" "$2" "$descr"
curtag="${curtag%:*}"
- eval "${2}=( \${(P)2} \$argv[4,-1] )"
+ set -A $2 "${(P@)2}" "${argv[4,-1][@]}"
else
_description "$gopt" "$curtag" "$2" "$3"
- eval "${2}=( \$argv[4,-1] \${(P)2} )"
+ set -A $2 "${argv[4,-1][@]}" "${(P@)2}"
fi
return 0
Messages sorted by:
Reverse Date,
Date,
Thread,
Author