Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] zipping two empty arrays should not result in empty string
- X-seq: zsh-users 22319
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: [PATCH] zipping two empty arrays should not result in empty string
- Date: Sun, 1 Jan 2017 12:27:09 -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=MOezLh+oySnx0Bf8jCSFGPL8+Er6kZCuTa/fAOo5Ucc=; b=XCvObpD69tnWabCbSVHkUo6dUwqZTjzGwCXpe5WmAcO78NIdRYattHU91gxYdmIlHf pLxekM03UbUQoEcjmhpeEcso686Cy8XeAsEtB3RXVjeug+7rsbTL0OdTzD8vaP+SFtmA /Rat+6NjSIAb1fvKAzG9UrIeL7guCypMcX1lEMLsMFydR3ZanCeCv1Kj+1cks6oldole Bl4bbCbMR+1WaP2ZRf1IVfW52lYLLYp0qf6/IrB2UYzVGvcNX3UZjZCPDZBE/PIyQRdI JS0g9RVTHnfv/QRSetIs15fEnKJ6MYuXp7yj18qwCDFKBtbR0nBHXBVb6+CmLMCfOm8+ EetQ==
- In-reply-to: <170101122451.ZM20755@torch.brasslantern.com>
- 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
- References: <98007a1c-8cd4-f6bf-36c4-65f046e8bc17@gmx.com> <170101122451.ZM20755@torch.brasslantern.com>
On Jan 1, 12:24pm, Bart Schaefer wrote:
}
} The zip operation is stepping on the internal state that records the
} semantics of (@)-inside-double-quotes, so it always behaves as if
} you did "${a[*]:^b}" instead.
Don't change isarr unless creating one from a scalar.
diff --git a/Src/subst.c b/Src/subst.c
index 64b4400..737a0a9 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -3066,7 +3066,10 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags,
if (sval)
zip = hmkarray(sval);
}
- if (!isarr) aval = mkarray(val);
+ if (!isarr) {
+ aval = mkarray(val);
+ isarr = 1;
+ }
if (zip) {
char **out;
int alen, ziplen, outlen, i = 0;
@@ -3089,7 +3092,6 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags,
out[i*2] = NULL;
aval = out;
copied = 1;
- isarr = 1;
}
} else {
if (unset(UNSET)) {
Messages sorted by:
Reverse Date,
Date,
Thread,
Author