Re: Output quoting (was: Re: Possible solution for special characters in makefile paths)
Frank Heckenbach <[email protected]> Thu, 10 Apr 2014 19:40:34 +0200
| Newsgroups | gmane.comp.gnu.make.devel |
|---|---|
| Message-ID | <[email protected]> |
Eli Zaretskii wrote: > > Date: Thu, 10 Apr 2014 12:56:19 +0200 > > From: Frank Heckenbach <[email protected]> > > > > > We've been there during past discussions. My opinion is: decode the > > > string, and let the user quote it if needed. This way, rules like this: > > > > > > > %.x: %.y > > > > process '$<' -o '$@' > > > > > > continue to work (or not ;-) as they did before. > > > > If we just want to have everything that works to continue working > > and everything that doesn't to continue not working, we don't need > > to change anything. ;) > > > > As I detailed before, it will be possible for the user to quote > > everything manually (if make's internal functions will support > > multi-word strings), but quite cumbersome, which in practice means > > users won't do it. (I mean, compared to what would be needed in > > make, quoting variables in shell scripts is easy, just add "" around > > your variables, yet I still see so many shell scripts failing to do > > so.) > > > > So I say if it's left to the user, make should at least provide a > > way to do this automatically and *by default*. Again, see my > > SHELL_QUOTE proposal (which would be automatically applied). If the > > user doesn't want quoting (or needs a different kind of quoting for > > another interpreter), they can unset or change SHELL_QUOTE, > > respectively, but for the normal case (sh-compatible interpreter), > > they shouldn't need to do anything. > > Maybe I'm just confused, but I don't see how what you say contradicts > what I said in any way. Maybe some example will help me see the > light. I didn't say there was a contradiction. The only one, kind of, is that I think the quoting should be done automatically by default (e.g. by having SHELL_QUOTE set by default and used automatically). This way, rules like this: %.x: %.y process '$<' -o '$@' will not continue to work if $</$@ contain special characters (which I think is not so bad because they already don't work if $</$@ contain a certain special character, i.e. '). Apart from this, I think we agree as far as this alternative is concerned. I'm still willing to consider other alternatives, e.g. storing and substituting backslash-quoted strings unmodified (based on your original proposal), but Paul sees to prefer this one.