[Geany-Devel] Placeholder replacement in (build) commands

Dimitar Zhekov dimitar.zhekov at xxxxx
Mon Mar 30 18:58:01 UTC 2015


On 30.3.2015 г. 20:18, Colomban Wendling wrote:

> To offload the discussion from PR#441 [1] from this partly off-topic
> discussion and give it more visibility, I'm moving it here to the ML.
> [...]

One thing I forgot to mention is that it would be good to have some kind 
of OS-variable (single|double) quotes for the static text. Under Unix, 
one would normally use ' to avoid file name and variable expansion, but 
under Windows, the normal quotes are double (unless using bash.exe or 
something).

That is, if the user specifies a build or printing command containing, 
say, «cx$dat.tmp», the Unix text must be single-quoted to avoid the 
expansion of $dat. But under Win~1, the single quotes are literal. And 
"cx\$dat.tmp" won't work either, \ under Win~1 will be literal[1].

Maybe %"cx$dat.tmp%", since we already use % as metacharacter?

In the case of solution 3.1,

 > 3.1. Insert quoted replacement as needed where they appear

the variable quote replacement must be done before any placeholders.

[1] Win~1 escaping rules in short: " is escaped with \, any literal \-es 
before a " must be duplicated, all other \-es are literal.

--
E-gards: Jimmy


More information about the Devel mailing list