Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] Allow '=' aliases to be used with -L
- X-seq: zsh-workers 42492
- From: Joey Pabalinas <joeypabalinas@xxxxxxxxx>
- To: "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Subject: [PATCH] Allow '=' aliases to be used with -L
- Date: Wed, 21 Mar 2018 15:19:05 -1000
- Cc: Joey Pabalinas <joeypabalinas@xxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=lueR9rndbQvumic8mmOZQE9ubZeg0x5D/lXUhPD5Mes=; b=Us6uKphMhZG4RsCphKgu8ag8HXU4RxiRh9+AHhJ2YXon6cSMTa9Fi1ZwavQ+CQbBd5 63ct053guVMQf170U5KyZqiBgDP6pegOnVJcG1z9RgYv2v4t4r6EvDEdtCqDzA5UAtzc xkLiT/FE3bQegPx9IU7NBGM66iBUMvSTVDUXcjXuHFrduZdZn2M/2n6nGoXecfWSkDkf MJXZxUGqtyMkHwlJt18pSlyC7GnnjhZGnbHYIa2o19nF7XyUFTJOP8I95v4ULkz5FXxm UIaDtIGLVP3Y0sPPIOHKZ1J9Qx6RNXYNaGjU1Y1SH68Kacjk5fuj2TgCPSchIMEWhUbP 89qw==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Special case '=' aliases so that they can be output correctly
by -L and be used in startup scripts.
Signed-off-by: Joey Pabalinas <joeypabalinas@xxxxxxxxx>
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/Src/hashtable.c b/Src/hashtable.c
index b7baa314220509240d..62f8e9df3b99b6d5e2 100644
--- a/Src/hashtable.c
+++ b/Src/hashtable.c
@@ -1303,11 +1303,17 @@ printaliasnode(HashNode hn, int printflags)
}
if (printflags & PRINT_LIST) {
- /* Fast fail on unrepresentable values. */
+ /*
+ * '=' aliases need to be special
+ * cased with direct alias table
+ * assignment (`aliases[=]=...`).
+ */
if (strchr(a->node.nam, '=')) {
- zwarn("invalid alias '%s' encountered while printing aliases",
- a->node.nam);
- /* ### TODO: Return an error status to the C caller */
+ printf("aliases[=]");
+ putchar('=');
+ quotedzputs(a->text, stdout);
+
+ putchar('\n');
return;
}
--
2.16.2
Attachment:
signature.asc
Description: PGP signature
Messages sorted by:
Reverse Date,
Date,
Thread,
Author