* Eric Blake wrote on Sun, Nov 16, 2008 at 10:42:12PM CET:
> > Apologies for not reviewing this closer. m4_quote doesn't like the
> > unbalanced unquoted ) you just introduced into _AS_VAR_ARITH_WORKS. You
> > need to either change that _AS_RUN to use m4_expand (which handles
> > unbalanced unquoted paren), or write [)] (so the parens are quoted), or
> > add balancing ( as a shell comment.
>
> On the other hand, the unbalanced unquoted ) you introduced was within
> _AS_VAR_ARITH_PREPARE as an argument of AS_IF (which happens to handle
> this use case), not _AS_VAR_ARITH_WORKS. But I'd still be more
> comfortable if we patched this to be more robust, if only so we are in the
> habit of properly quoting or balancing parens for where it matters.
Do you mean the AS_REQUIRE_SHELL_FN machinery should be more robust?
If yes, I guess I agree.
Not sure if you mean that I should still commit this.
Thanks,
Ralf
* lib/m4sugar/m4sh.m4 (_AS_VAR_ARITH_PREPARE): Balance case
parentheses from last change.
Spotted by Eric Blake.
diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4
index 56697ad..adf7eb0 100644
--- a/lib/m4sugar/m4sh.m4
+++ b/lib/m4sugar/m4sh.m4
@@ -1743,7 +1743,10 @@
AS_IF([_AS_RUN(["AS_ESCAPE(m4_quote(_AS_VAR_ARITH_WORKS))"])],
[as_func_arith ()
{
as_val=`expr "$[]@"`
- case $? in 0|1) :;; *) false;; esac
+ case $? in #(
+ 0|1) :;; #(
+ *) false;;
+ esac
}]) # as_func_arith
])