Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Spurious "no match" (Re: Remind me why ${name+word} is the way it is?)
- X-seq: zsh-workers 40034
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Spurious "no match" (Re: Remind me why ${name+word} is the way it is?)
- Date: Mon, 28 Nov 2016 22:44:50 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=gvnoh2O7HY9OelpzMvq2ziS7dr7fuO6ICXbABPz4+vw=; b=OTPIR/DtM8RZ9NqDTnzlrtLa7ZPEwm3eSwa2jXpAjzksdw7EbnHbnnbVjz4hrMzqr4 5MXUOClGT44IsPhfgd0T/ki3nEYyqmk8Z6lUWyjr8XQisvlMyPR/fT4eYi2gKSjj1YR2 qMwVaThTwY+b6N7rzZZ/dr32kDGZQl0Ebj4+l97V01OPbLOLrJlEhK0PO28/WtTXi9H1 D1t6Kt/MMIgyUAGtZdQD8lHTxNbWK20S1nUHEbUABeVKiIcHSt97QMVadyZXPGugW6+r Xg4o8E+UqQRq+1/PfZTyo24kgzB/U0zN8nqf/2Tr/5R9bbhqasfmqJ1F0hUvd4vFVmtH yvrg==
- In-reply-to: <20161123012650.GA4241@localhost.localdomain>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <161111203400.ZM31567@torch.brasslantern.com> <20161117023325.GA3324@localhost.localdomain> <CAH+w=7YbPRhK1Mw0P7DKObaYU2vXCuECUGkvwp1d2R4K0dC7CA@mail.gmail.com> <20161123012650.GA4241@localhost.localdomain>
On Nov 23, 9:26am, Han Pingtian wrote:
} Subject: Re: Remind me why ${name+word} is the way it is?
}
} On Wed, Nov 16, 2016 at 09:34:32PM -0800, Bart Schaefer wrote:
} > On Wed, Nov 16, 2016 at 6:33 PM, Han Pingtian <hanpt@xxxxxxxxxxxxxxxxxx> wrote:
} > >
} > > % name=a;echo ${name:+foo[bar]}
} > > zsh: no match
} > > %
} > > url-quote-magic:10: no match
} >
} Oh, I can still reproduce this problem by running
}
} name=a;echo ${name:+foo[bar]}
}
} two times.
So, this isn't url-quote-magic's fault -- the value of the internal C
variable badcshglob is never getting cleared after the error has been
ignored, so it trips the next time any command passes through a test
for whether a glob has failed. Any user-defined widget that assigns
to an array ought to generate the same error.
This seems to do the right thing, but someone please review:
diff --git a/Src/subst.c b/Src/subst.c
index c7c5522..42e741a 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -411,7 +411,9 @@ globlist(LinkList list, int nountok)
next = nextnode(node);
zglob(list, node, nountok);
}
- if (badcshglob == 1)
+ if (noerrs)
+ badcshglob = 0;
+ else if (badcshglob == 1)
zerr("no match");
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author