Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Allow '=' aliases to be used with -L
- X-seq: zsh-workers 42506
- From: "Nikolay Aleksandrovich Pavlov (ZyX)" <kp-pav@xxxxxxxxx>
- To: Joey Pabalinas <joeypabalinas@xxxxxxxxx>, "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH] Allow '=' aliases to be used with -L
- Date: Fri, 23 Mar 2018 13:09:10 +0300
- Authentication-results: mxback3j.mail.yandex.net; dkim=pass header.i=@yandex.ru
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1521799750; bh=hxLfsCwDBfFj8PqabZpnUr3TkPRIuAVVoPmzSdeiyn0=; h=From:To:In-Reply-To:References:Subject:Message-Id:Date; b=QXkBDwJIUE70PDOzxXfehi56DoyJygLHVOiiqR06IlH86cGvg8mRt6Oo8s+T8vmV6 +R7ZlRCbqr/dqkF9WZD7paOezdMMKAem4g3OjMSROdxj6u7fsusabBrtLJvOHm2/4Q Z7lNKn0OF0HcuWIN3RrQH6b+0kgXSd0FIek8rlI0=
- In-reply-to: <20180322011905.45n377wsxp62k57e@gmail.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>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20180322011905.45n377wsxp62k57e@gmail.com>
22.03.2018, 04:19, "Joey Pabalinas" <joeypabalinas@xxxxxxxxx>:
> 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[=]");
This looks like all aliases having `=` in them will be printed with exactly the same key `=`, including those which are not equal to `=`.
> + putchar('=');
> + quotedzputs(a->text, stdout);
> +
> + putchar('\n');
> return;
> }
>
> --
> 2.16.2
Messages sorted by:
Reverse Date,
Date,
Thread,
Author