[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 5/5] m4sh: assume ${a:-b} support
From: |
Ralf Wildenhues |
Subject: |
Re: [PATCH 5/5] m4sh: assume ${a:-b} support |
Date: |
Thu, 26 Aug 2010 19:38:49 +0200 |
User-agent: |
Mutt/1.5.20 (2010-04-22) |
* Eric Blake wrote on Thu, Aug 26, 2010 at 01:18:21AM CEST:
> --- a/lib/m4sugar/m4sh.m4
> +++ b/lib/m4sugar/m4sh.m4
> @@ -1981,10 +1987,12 @@ m4_define([AS_VAR_GET],
> # Polymorphic, and avoids sh expansion error upon interrupt or term signal.
> m4_define([AS_VAR_IF],
> [AS_LITERAL_WORD_IF([$1],
> - [AS_IF([test "x$$1" = x""$2]],
> + [AS_IF(m4_ifval([$2], [[test "x$$1" = x$2]], [[${$1:+false} :]])],
> [AS_VAR_COPY([as_val], [$1])
> - AS_IF([test "x$as_val" = x""$2]],
> - [AS_IF([eval test \"x\$"$1"\" = x"_AS_ESCAPE([$2], [`], [\"$])"]]),
> + AS_IF(m4_ifval([$2], [[test "x$as_val" = x$2]], [[${as_val:+false} :]])],
> + [AS_IF(m4_ifval([$2],
> + [[eval test \"x\$"$1"\" = x"_AS_ESCAPE([$2], [`], [\"$])"]],
> + [[eval \${$1:+false} :]])]),
> [$3], [$4])])
This looks like it's also changing the number of times the macro
arguments are evaluated. I wonder if there is user code relying
on that ...
Cheers,
Ralf
- Re: [PATCH 2/5] docs: mention cost of globbing during variable expansion, (continued)
- Re: [PATCH 2/5] docs: mention cost of globbing during variable expansion, Eric Blake, 2010/08/26
- [PATCH 3/5] tests: improve some shell assumption testing, Eric Blake, 2010/08/25
- [PATCH 0/5] more aggressive on ${a:-b}, Eric Blake, 2010/08/25
- Re: [PATCH 0/5] more aggressive on ${a:-b}, Ralf Wildenhues, 2010/08/26
- Re: [PATCH 0/5] more aggressive on ${a:-b}, Eric Blake, 2010/08/26
- Re: [PATCH 0/5] more aggressive on ${a:-b}, Ralf Wildenhues, 2010/08/26
- Re: [PATCH 0/5] more aggressive on ${a:-b}, Eric Blake, 2010/08/27
- Re: [PATCH 0/5] more aggressive on ${a:-b}, Ralf Wildenhues, 2010/08/27
- Re: [PATCH 0/5] more aggressive on ${a:-b}, Eric Blake, 2010/08/27
- [PATCH 5/5] m4sh: assume ${a:-b} support, Eric Blake, 2010/08/25
- Re: [PATCH 5/5] m4sh: assume ${a:-b} support,
Ralf Wildenhues <=
- Re: [PATCH 5/5] m4sh: assume ${a:-b} support, Eric Blake, 2010/08/26