<blockquote>
<p>The internal Geany code swallows quotes of %s.</p>
</blockquote>
<p>Yes, this allows %s to contain spaces without being split into several arguments.</p>
<p>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.</p>
<p>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.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/1801#issuecomment-372925872">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJxJGUCIAM05uDHwTve4VNXrj-cEHks5teMMygaJpZM4Somkz">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABDrJ42yb7128ft8UClf6pokT0wYVSyFks5teMMygaJpZM4Somkz.gif" height="1" width="1" alt="" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/issues/1801#issuecomment-372925872"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany","title":"geany/geany","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany"}},"updates":{"snippets":[{"icon":"PERSON","message":"@elextr in #1801: \u003e The internal Geany code swallows quotes of %s.\r\n\r\nYes, this allows %s to contain spaces without being split into several arguments.\r\n\r\nTo 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.\r\n\r\nBut 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."}],"action":{"name":"View Issue","url":"https://github.com/geany/geany/issues/1801#issuecomment-372925872"}}}</script>