Hello Randall, * Randall Cotton wrote on Mon, Aug 16, 2010 at 10:16:57PM CEST: > [AS_IF([test "x$$1" = x""$2], [$3], [$4])], > ...here ^^^^ > AS_IF([test "x$as_val" = x""$2], [$3], [$4])])]) > ...AND here ^^^^ > > It seems likely that x""$2 was meant to be "x$2".
No, this code is really meant to be like this. The "" serve as convenient separator that avoid that x and $2 can form the name of a m4 macro upon expansion. > A workaround would be to shell-quote the second argument to AS_VAR_IF, as > in: > AS_VAR_IF([testvar], ["blah blah"], [printf "compare OK\n"], [printf "compare That's the way to go in your code. > But the documentation makes no mention that this is required. Then the documentation needs fixing. > Furthermore, > it seems unnecessary to inflict such a requirement. Well, problem is, the user might just prefer single quotes, or some more complicated construct. With the current code, she can eat that cake too, but with fixed double-quoting that is ugly. Cheers, and thanks for the bug report, Ralf