[Geany-Devel] Escaping replacement for placeholder in build commands

Dimitar Zhekov dimitar.zhekov at gmail.com
Fri Dec 14 18:25:59 UTC 2012


On Fri, 14 Dec 2012 17:53:06 +0100
Colomban Wendling <lists.ban at herbesfolles.org> wrote:

> Apart some more testing, I had some doubts about Windows compatibility
> here.  Will the windows spawn code deal correctly with the escapes? If
> not, how to escape for Windows too?

Win~1 filenames can not contain " \ ? * and some other characters.
Whether filenames with spaces are automatically quoted when creating a
win~1 command line depends on the exec/spawn function used; the actual
CreateProcess() uses a string, not char **.

As of the win~1 escaping, here is a small program I wrote 10(?) years
ago, which takes **argv, quotes them and creates a string, so that if a
system() call is executed, the program started receives the same args.

The WIN32 shell re-quoting looks pretty simple, but I can't remember why
isn't \ escaped too, or whether a fully correct re-quoting is possible
for win~1 cmd. Hope that helps...

-- 
E-gards: Jimmy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: requote.c
Type: text/x-csrc
Size: 1507 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20121214/61c14223/attachment.c>


More information about the Devel mailing list