Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH 2/3] jp: Use `(nil)` for empty identifier strings
- X-seq: zsh-workers 42278
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH 2/3] jp: Use `(nil)` for empty identifier strings
- Date: Sun, 14 Jan 2018 15:43:08 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=XAE+AH d1Mz5dN42SS1ReuYt6xMA8xTlWJKWOqEfDfOc=; b=FQ4BUmlDrdDXwp7af2cSqt 16EGKQqEfpvomhnElx83tR/2rsHSBWJUXjfbV1uadupuMzNkazfGyMEI2F0ZWX5m 6ggRX3UwY4ez5BzWdaka2rAm6xTqIAZ0RnW2KlMcrmU5eySeRZ3jiVr/4gUbsjnL TgYQDw4zP/ZTmJDVClgd31Y0a86IzXCvRk7aB0r8D4j1tqom/wdS2e878G+eCc5A LIejCJ5Hp1eQyPGQmUDNBxDRsNvmdUKURkgV7eNueYRjYamqWmrw/o95HeKWEwJR loN7/sHqgJtNParODUmRzusruj6m95de5CzmacJa9fshBT4M3CbRlprIKdgtPnKQ ==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=XAE+AH d1Mz5dN42SS1ReuYt6xMA8xTlWJKWOqEfDfOc=; b=kpLmfoA4dKSJzYhBqebVEh KptecZjRYwAvsi9d0pJEyztt+GD3vOwCtW624JKYPbOQJI142lcR+22EBMwpoxC1 Don/rVnev9valBm72wvwQ8vjAvn3d9Xc64szwjPwS8Lk+3GmdEdpmNvPWzBVG6lO CfGDJ1U+avRJMo9jM8Rai4YIHieGGyPS6Uh2Kcnk36s/rdAvZZPoeaVF19D2R5qY MRSqu2YrJoDVrEkOc5RYaN16AhkuXIZHKci3RllZr35pJi7IEuwZ9NufdTyTZloq NArDUYcPSGEKbXlmq5P1rh1urIfzgrxPbEPTfEOLvwG5Eb0pk0a0Iu0ymuB8HNnA ==
- In-reply-to: <20180114152344.12018-3-joeypabalinas@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: <20180114152344.12018-1-joeypabalinas@gmail.com> <20180114152344.12018-3-joeypabalinas@gmail.com>
Joey Pabalinas wrote on Sun, 14 Jan 2018 05:23 -1000:
> +++ b/Src/params.c
> @@ -3004,6 +3004,8 @@ assignsparam(char *s, char *val, int flags)
> int sstart, created = 0;
>
> if (!isident(s)) {
> + if (!strcmp(s, ""))
> + s = "(nil)";
> zerr("not an identifier: %s", s);
How about inventing an %ls expando that emits the argument quoted, so
zerr("%ls", foo) would print ${(qq)foo} or ${(q-)foo}. That seems easier
than updating all callsites (not just these three).
(%ls/%s by analogy with %ld/%d.)
Cheers,
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author