<p>In <a href="https://github.com/geany/geany/pull/629#discussion_r38926442">src/plugins.c</a>:</p>
<pre style='color:#555'>> @@ -830,6 +1000,52 @@ static gboolean check_plugin_path(const gchar *fname)
> }
>
>
> +/* Retuns NULL if this ain't a plugin,
> + * otherwise it returns the appropriate PluginProxy instance to load it */
> +static PluginProxy* is_plugin(const gchar *file)
> +{
> + PluginProxy *proxy;
> + const gchar *tmp;
> + gint i;
> +
> + /* extract file extension to avoid g_str_has_suffix() in the loop */
> + tmp = (const gchar *)g_utf8_strrchr(file, -1, '.');
> + if (tmp == NULL)
> + return FALSE;
> + /* ensure the dot is really part of the filename */
> + else if (strchr(tmp, G_DIR_SEPARATOR) != NULL)
</pre>
<p>We don't deconstruct paths manually very often, and would generally use <code>g_path_get_basename()</code>. But we do have <a href="https://github.com/geany/geany/tree/master/src/utils.c#L1795"><code>utils_tidy_path()</code></a> that does it. I'm not certain we need it here, but I could easily imagine it could happen.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/geany/geany/pull/629/files#r38926442">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ-7MzkHNztEww3pcyApHS08JvP1Iks5ovt3jgaJpZM4Fy7fG.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/629/files#r38926442"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>