<p dir="auto">The filename from commandline argument is being processed directly, without first resolving symlinks. This leads to bug <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="246854249" data-permission-text="Title is private" data-url="https://github.com/geany/geany/issues/1567" data-hovercard-type="issue" data-hovercard-url="/geany/geany/issues/1567/hovercard" href="https://github.com/geany/geany/issues/1567">#1567</a>, where Geany fails to open existing file, if it is being opened using path containing symlink and relative directories.</p>
<p dir="auto">Windows counterpart of this code actually resolves the links, I have just corrected the non-win branch. This fixes the bug described in the bug report and should not have any unwanted side-effects.</p>
<p dir="auto">Similar problem might (or might not) be also present in two other functions that use utils_tidy_path, without resolving the symlinks first:</p>
<ul dir="auto">
<li>in <code>document_new_file</code> at <a href="https://github.com/geany/geany/blob/b524a58e12e85c94a32f64fb72615978b2628af1/src/document.c#L832">src/document.c:832</a></li>
<li>in <code>get_custom_plugin_path</code> at <a href="https://github.com/geany/geany/blob/b524a58e12e85c94a32f64fb72615978b2628af1/src/plugins.c#L1009">src/plugins.c:1009</a></li>
</ul>
<p dir="auto">I'm not sure if it is appropriate to check and possibly fix those in the same PR.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/geany/geany/pull/3036'>https://github.com/geany/geany/pull/3036</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/geany/geany/pull/3036/commits/eba107781275d11cf8078e5f05b9a93c50c8ed18" class="commit-link">eba1077</a>  resolve symlink before the path is tidied (#1567)</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/geany/geany/pull/3036/files">1 file</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/3036/files#diff-90e39f5f0dfc1344b1b22db34414d3623c2d53cfedcb89e870e24fbb55c93d36">src/document.c</a>
    (2)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/geany/geany/pull/3036.patch'>https://github.com/geany/geany/pull/3036.patch</a></li>
  <li><a href='https://github.com/geany/geany/pull/3036.diff'>https://github.com/geany/geany/pull/3036.diff</a></li>
</ul>

<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/3036">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJY3EPR7NHD6CFDOFNLUOWVS3ANCNFSM5JDRIGQQ">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<img src="https://github.com/notifications/beacon/AAIOWJ3FE6XF7ER74ZKGLOLUOWVS3A5CNFSM5JDRIGQ2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4P5H7IYA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/pull/3036",
"url": "https://github.com/geany/geany/pull/3036",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>