Re: [PATCH 1/2] pager: move pager-specific setup into the build

2016-08-01 Thread Duy Nguyen
On Mon, Aug 1, 2016 at 7:52 PM, Jeff King wrote: > On Mon, Aug 01, 2016 at 07:46:34PM +0200, Duy Nguyen wrote: > >> On Mon, Aug 1, 2016 at 3:05 AM, Eric Wong wrote: >> > From: Junio C Hamano >> > >> > Allowing PAGER_ENV to be set at build-time

Re: [PATCH 1/2] pager: move pager-specific setup into the build

2016-08-01 Thread Junio C Hamano
Jeff King writes: > I'm not too worried about spaces here. This is a resurrection of an old > discussion, and in all that time, I think the only realistic suggestions > for built-in values have been pretty tame. > > If this were used to parse arbitrary user-provided runtime

Re: [PATCH 1/2] pager: move pager-specific setup into the build

2016-08-01 Thread Jeff King
On Mon, Aug 01, 2016 at 08:01:13PM +0200, Duy Nguyen wrote: > > If you are interested, I suggest you read the thread linked earlier: > > > > https://public-inbox.org/git/52D87A79.6060600%40rawbw.com/T/#u > > > > which discusses this and other issues. But basically, I think you cannot > > really

Re: [PATCH 1/2] pager: move pager-specific setup into the build

2016-08-01 Thread Jeff King
On Mon, Aug 01, 2016 at 07:46:34PM +0200, Duy Nguyen wrote: > On Mon, Aug 1, 2016 at 3:05 AM, Eric Wong wrote: > > From: Junio C Hamano > > > > Allowing PAGER_ENV to be set at build-time allows us to move > > pager-specific knowledge out of our build.

Re: [PATCH 1/2] pager: move pager-specific setup into the build

2016-08-01 Thread Duy Nguyen
On Mon, Aug 1, 2016 at 3:05 AM, Eric Wong wrote: > From: Junio C Hamano > > Allowing PAGER_ENV to be set at build-time allows us to move > pager-specific knowledge out of our build. Currently, this > allows us to set a better default for FreeBSD where more(1)

Re: [PATCH 1/2] pager: move pager-specific setup into the build

2016-08-01 Thread Jeff King
On Mon, Aug 01, 2016 at 01:43:03AM +, brian m. carlson wrote: > On Mon, Aug 01, 2016 at 01:05:56AM +, Eric Wong wrote: > > +static void setup_pager_env(struct argv_array *env) > > +{ > > + const char *pager_env = stringify(PAGER_ENV); > > + > > + while (*pager_env) { > > +

Re: [PATCH 1/2] pager: move pager-specific setup into the build

2016-08-01 Thread brian m. carlson
On Mon, Aug 01, 2016 at 10:57:02AM +0200, Jakub Narębski wrote: > W dniu 01.08.2016 o 09:00, Eric Wong pisze: > > "brian m. carlson" wrote: > >> So it looks like this function splits on spaces but doesn't provide any > >> escaping mechanism. Is there any case in

Re: [PATCH 1/2] pager: move pager-specific setup into the build

2016-08-01 Thread Jakub Narębski
W dniu 01.08.2016 o 09:00, Eric Wong pisze: > "brian m. carlson" wrote: >> On Mon, Aug 01, 2016 at 01:05:56AM +, Eric Wong wrote: >>> + while (*cp && *cp == ' ') >>> + cp++; >> >> So it looks like this function splits on spaces but

Re: [PATCH 1/2] pager: move pager-specific setup into the build

2016-08-01 Thread Eric Wong
"brian m. carlson" wrote: > On Mon, Aug 01, 2016 at 01:05:56AM +, Eric Wong wrote: > > + while (*cp && *cp == ' ') > > + cp++; > > So it looks like this function splits on spaces but doesn't provide any > escaping mechanism. Is there

Re: [PATCH 1/2] pager: move pager-specific setup into the build

2016-07-31 Thread brian m. carlson
On Mon, Aug 01, 2016 at 01:05:56AM +, Eric Wong wrote: > +static void setup_pager_env(struct argv_array *env) > +{ > + const char *pager_env = stringify(PAGER_ENV); > + > + while (*pager_env) { > + struct strbuf buf = STRBUF_INIT; > + const char *cp =

[PATCH 1/2] pager: move pager-specific setup into the build

2016-07-31 Thread Eric Wong
From: Junio C Hamano Allowing PAGER_ENV to be set at build-time allows us to move pager-specific knowledge out of our build. Currently, this allows us to set a better default for FreeBSD where more(1) is the same binary as less(1). This also prepares us for introducing a