From: Oliver Kiddle <opk@u.genie.co.uk>
To: Zsh workers <zsh-workers@sunsite.auc.dk>
Subject: PATCH: _next_label losing empty arguments
Date: Mon, 22 May 2000 19:12:34 +0100 [thread overview]
Message-ID: <39297892.9878595A@u.genie.co.uk> (raw)
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
next reply other threads:[~2000-05-22 18:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-05-22 18:12 Oliver Kiddle [this message]
2000-05-22 18:33 ` Bart Schaefer
2000-05-23 8:51 Sven Wischnowsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=39297892.9878595A@u.genie.co.uk \
--to=opk@u.genie.co.uk \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).