<blockquote>
<p>Better to make the change inside the filename so the extension is unchanged.</p>
</blockquote>

<p>I thought about that version, but it would make the code more complicated for just a simple feature.  You'd have to do some splitting and use more temporary strings than just use <code>g_strdup_sprintf()</code>.  It's also unclear how you'd get the no-extension part of the filename that has multiple dots in it, and it could mean more code as well.</p>

<p>I also don't think all people would want that version since appending an extension to a copy or backup is a common convention.  A lot of people do <code>cp filename.ext{,.orig}</code> or <code>cp filename.ext{,.copy}</code>.  I also find it more descriptive, even when done recursively like <code>filename.ext.clone.clone</code>, and is also consistent with the manner on how other file formats are named like <code>.tar.gz</code>.  Besides, a clone is meant to be renamed anyway, when it's needed to be used to something other than just a copy.</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/pull/1197#issuecomment-243422679">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJwAaAKhf0AGkNWnlBGmoS7b2ev7Cks5qlCIJgaJpZM4JwZvb">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJwY15UKZN33Re5cJrI87VA6Wb40Yks5qlCIJgaJpZM4JwZvb.gif" width="1" /></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/pull/1197#issuecomment-243422679"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request 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":"@konsolebox in #1197: \u003e Better to make the change inside the filename so the extension is unchanged.\r\n\r\nI thought about that version, but it would make the code more complicated for just a simple feature.  You'd have to do some splitting and use more temporary strings than just use `g_strdup_sprintf()`.  It's also unclear how you'd get the no-extension part of the filename that has multiple dots in it, and it could mean more code as well.\r\n\r\nI also don't think all people would want that version since appending an extension to a copy or backup is a common convention.  A lot of people do `cp filename.ext{,.orig}` or `cp filename.ext{,.copy}`.  I also find it more descriptive, even when done recursively like `filename.ext.clone.clone`, and is also consistent with the manner on how other file formats are named like `.tar.gz`.  Besides, a clone is meant to be renamed anyway, when it's needed to be used to something other than just a copy."}],"action":{"name":"View Pull Request","url":"https://github.com/geany/geany/pull/1197#issuecomment-243422679"}}}</script>