Re: [PATCH 0/1 v2] add PAGER_ENV to build
- From
Jeff King <peff@peff.net>
- Date
- Aug 1, 2016, 21:59 UTC
- Message-ID
- <20160801215904.5oym63j3ewqyqugx@sigill.intra.peff.net>
- In-Reply-To
- <20160801214937.4752-1-e@80x24.org>
On Mon, Aug 01, 2016 at 09:49:36PM +0000, Eric Wong wrote:
Show 8 quoted lines
> Changes from v1: > > * dropped stringify macro in favor for quoting in Makefile > (diff below) > I'm not sure I like this change, and might be inclined to > go in the opposite direction of using the stringify macro > more widely to simplify the Makefile; but that is a separate > topic.
I think that's a dangerous direction. Try this:
-- >8 -- cat >foo.c <<\EOF #include <stdio.h>
#define stringify_(x) #x #define stringify(x) stringify_(x)
int main(void)
{
printf("%s", stringify(FOO));
return 0;
}
EOFwhile read -r input; do gcc -Wall -Werror -DFOO="$input" foo.c ./a.out done -- 8< --
and then try input like:
this has a lot of spaces this has a \backslash
You should see:
this has a lot of spaces this has aackslash
I'll grant that backslashes and runs of whitespace are not things we'd expect to find in most of our build-time config, but it still seems like a bad direction to go (and actually, I wouldn't be surprised if backslashes do end up in some of our build-time variables on Windows).
-Peff