<p></p>
<p><b>@codebrainz</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/geany/geany/pull/2586#discussion_r488331350">src/project.c</a>:</p>
<pre style='color:#555'>> +                    /* get last path_delimiter so we know the path */
+                       int i;
+                       int last_path_delimiter;
+                       for (i = 0; locale_filename[i] != '\0'; ++i) {
+                               if (locale_filename[i] == path_delimiter) {
+                                       last_path_delimiter = i;
+                               }
+                       }
+
+                       /* get substring containing only the filename path */
+                       gchar *filename_path = g_malloc((last_path_delimiter + 2) * sizeof(char));
+                       strncpy(filename_path, locale_filename, last_path_delimiter + 1);
+                       filename_path[last_path_delimiter + 1] = '\0';
</pre>
<p>If I understand correctly the intention here, I believe these lines could be reduced to:</p>
<div class="highlight highlight-source-c"><pre>gchar *filename_path = g_path_get_dirname(locale_filename);</pre></div>
<p>GLib makes C quite a bit less painful <g-emoji class="g-emoji" alias="wink" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f609.png">😉</g-emoji></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/2586#pullrequestreview-488264298">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ5VNSPZZPKDYTFHURLSF3A43ANCNFSM4RLUS2GA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAIOWJ7GV2CFT7ZUNKDLWP3SF3A43A5CNFSM4RLUS2GKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGODUNFE2Q.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/2586#pullrequestreview-488264298",
"url": "https://github.com/geany/geany/pull/2586#pullrequestreview-488264298",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>