Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug in if... then if... parsing
- X-seq: zsh-workers 38106
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Bug in if... then if... parsing
- Date: Sun, 6 Mar 2016 15:05:46 -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=/czKjECiXsKWvAqWouIlPnETNsWYlKrR+Zqd10PCGlU=; b=lBXCUodJCGGfPNDxczjfqUbtGSSkbXzhFZ/tx+EwGb6yXgp8pSJE+FwWduPukcI2Gx 2R4tw+xa6gZsjUaUwhH0JgcJD0S7mR/pHxfvmfdzH5c8NUqwXB8iOjLBbuRBsVXLa0Mf 1qNmYFixXDw49S5Oe1raze420JKDOwMRQAWKGzUOTDHuMPfDvTzYn5E4bKETKlLebOYL DTheukG4iSoXiB99J+ULQmoOr0C9e+5/axR0U8DCFfEKHJ9Ly4KwtIUBJi22qR2lqzpP N/hbmzV+S6WvWc6qW0iEwcGkRZ873z7D9bd2kHJXjgdNa9tp9Me4Ihkzc6cCAiy97F7Q RYxg==
- In-reply-to: <160306142731.ZM3208@torch.brasslantern.com>
- 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: <160306142731.ZM3208@torch.brasslantern.com>
On Mar 6, 2:27pm, Bart Schaefer wrote:
}
} As far as I can tell this only happens when "if" immediately follows "then".
The following seems to be the simplest fix. I was afraid this was going
to be a lot harder to track down.
Does anyone recall why par_list() and par_list1() return a value when
literally nothing ever examines that value? What does the 1 or 0 that
is returned even mean?
diff --git a/Src/parse.c b/Src/parse.c
index 628a9aa..349d1e4 100644
--- a/Src/parse.c
+++ b/Src/parse.c
@@ -1413,7 +1413,7 @@ par_if(int *cmplx)
}
}
cmdpop();
- if (xtok == ELSE) {
+ if (xtok == ELSE || tok == ELSE) {
pp = ecadd(0);
cmdpush(CS_ELSE);
while (tok == SEPER)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author