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" <sandals@xxxxxxxxxxxxxxxxxxxx> wrote: > >> So it looks like this function splits on spaces but doesn't provide any > >> escaping mechanism. Is there any case in which we want to accept > >> environment variables containing whitespace? I ask this as someone that > >> has EDITOR set to "gvim -f" on occasion and seeing how tools sometimes > >> handle that poorly. > > This is to handle environment variables holding program options, > which are usually (but possibly not often) using single character > options bundled together, that is, not using spaces. > > Moreover, it is about holding program options to pager. I understand that. My point is that we should consider corner cases like how we're going to handle spaces. > > Yes, it's only split on spaces right now. While I don't think > > there's any current case where spaces would be useful/desirable; > > I suppose a 3rd patch in this series could add support for using > > split_cmdline (from alias.c)... > > Is there any pager that needs spaces in options-set environment > variable? Does MORE allow option bundling? We seem to accept GIT_PAGER="par | less" and par definitely accepts spaces in its environment variables. That seems to be a corner case, though, and I haven't seen par practically used in years. We may also want to consider EXINIT for people who pipe to vi. Again, I'm not sure this is very common; most people would use an .exrc or .vimrc. I'd say if we can't come up with any better examples, I'd skip handling it for now. I'll try to come up with a patch to add it later. -- brian m. carlson / brian with sandals: Houston, Texas, US +1 832 623 2791 | https://www.crustytoothpaste.net/~bmc | My opinion only OpenPGP: https://keybase.io/bk2204
Attachment:
signature.asc
Description: PGP signature