Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Possible bug: Zsh function does not terminate when ${name:?word} fails
- X-seq: zsh-users 21902
- From: Ronald Fischer <ynnor@xxxxx>
- To: "Zsh Mailing-List" <zsh-users@xxxxxxx>
- Subject: Possible bug: Zsh function does not terminate when ${name:?word} fails
- Date: Wed, 14 Sep 2016 10:00:44 +0200
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=mm.st; h= content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=X6v /xmW+zkhhJiQKN3KhpK9jwDA=; b=lHcaRFxhxi0dU/qLUYjILncl8o+sNFlM63U KEfWKtUq4FdHlu1rMW326G/T++LS893PYxNJmQs7VMmbGgRi/N6oOQH8VuENMIJv Cw1NvXl7AFZolc4/cGZ2MVANxNcbJO8ku3C0TaT8V3ju9Jt+I6hyPlE5uV9pI0UV WRJTLGAg=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=X6v/xmW+zkhhJiQKN3KhpK9jwDA=; b=RwXh6 CVNYrmOI3j6PTk9Pdcch4NOWr4legg95zDz+oJpi0YqwKLQxpozrVIHCjAwxEyda rm/PydUvbqJS0FEeug2PmYp1e2Qm3Gapc6kJjXF+zbr1jcLFADiZYuK0UcjdhfhN hLoQj28cGc6vOYlOo+G/nQ+y5CM7Cauba3cZ/Q=
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
(See also for a complete discussion:
http://stackoverflow.com/questions/39463547/zsh-function-does-not-terminate-when-nameword-fails?noredirect=1#comment66276136_39463547)
I have in my .zshrc the following function definition (simplified
example):
function foo {
local p=${1:?parameter missing}
echo continue ....
}
Running the function by just typing foo produces, as expected, the
message parameter missing, but it also outputs continue. I had expected
that the function terminates when the :? check fails, but it continues
to run.
I tested this with zsh 5.1.1, but I was informed that this behaviour
also can be reproduced with zsh 5.2
Ronald
Messages sorted by:
Reverse Date,
Date,
Thread,
Author