<p></p>
<p><b>@kugel-</b> requested changes on this pull request.</p>

<hr>

<p>In <a href="https://github.com/geany/geany/pull/3024#discussion_r810357954">src/utils.c</a>:</p>
<pre style='color:#555'>> +            if (size > PATH_MAX)
+                       return NULL;
+               else
+                       return resolved_path;
+       }
+       else
+       {
+               size = GetFullPathNameA(pathname, 0, NULL, NULL);
+               resolved_path = g_new0(char, size);
+               GetFullPathNameA(pathname, size, resolved_path, NULL);
+               return resolved_path;
+       }
+}
+#endif
+
+
 /**
  * Get a link-dereferenced, absolute version of a file name.
  *
  * This is similar to the POSIX `realpath` function when passed a
  * @c NULL argument.
</pre>
<p dir="auto">I think we can be clear here and say that this <em>is</em> realpath, except on Windows.</p>

<hr>

<p>In <a href="https://github.com/geany/geany/pull/3024#discussion_r810357976">src/utils.c</a>:</p>
<pre style='color:#555'>> @@ -2436,7 +2463,12 @@ void utils_start_new_geany_instance(const gchar *doc_path)
 GEANY_API_SYMBOL
 gchar *utils_get_real_path(const gchar *file_name)
 {
-       return tm_get_real_path(file_name);
+       gchar *path = NULL;
+
+       if (file_name)
+               path = realpath(file_name, NULL);
</pre>
<p dir="auto">We don't really need to implement a wrapper for <code>realpath()</code> if the only caller always passes NULL.</p>
<p dir="auto">I suggest this</p>
<pre><code>gchar *path = NULL;

if (file_name)
{
#if defined(G_OS_WIN32) && !defined(HAVE_REALPATH)
    gsize size = GetFullPathNameA(pathname, 0, NULL, NULL);
    path = g_new0(char, size);
    GetFullPathNameA(pathname, size, path, NULL);
#else
    path = realpath(file_name, NULL);
#endif
}
return path;
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/3024#pullrequestreview-887782202">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ4XOXFLQJDFIAK6XKLU324PTANCNFSM5I4G3H2A">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>.
<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAIOWJ36IQKL5K2ZLHMAWQTU324PTA5CNFSM5I4G3H2KYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOGTVHWOQ.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><geany/geany/pull/3024/review/887782202</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/pull/3024#pullrequestreview-887782202",
"url": "https://github.com/geany/geany/pull/3024#pullrequestreview-887782202",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>