[Github-comments] [geany/geany] Internal problem of Geany's context action & Run/Compile/Build commands (#1801)

elextr notifications at xxxxx
Wed Mar 14 07:13:55 UTC 2018


> The internal Geany code swallows quotes of %s.

Yes, this allows %s to contain spaces without being split into several arguments.

To expand, on *ix systems commands are not passed to the system as a single string as they are input in build or context command settings.  The system takes an array with each argument a separate string.  So Geany has to split the command into arguments, which it does using a Glib function that mimics the way the shell splits command strings into arguments.  So like the shell things in quotes are made a single argument, even if they contain spaces, and the quotes are removed.

But since xterm runs the command in a shell, it has to re-combine the arguments to pass a string to the shell as if it had been typed at the command line, and the shell then splits it apart again.  So as you can see there is plenty of scope for arguments boundaries to get mixed up.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/1801#issuecomment-372925872
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20180314/9ca2d9be/attachment-0001.html>


More information about the Github-comments mailing list