From d4b3a05678d149051f5c2bbd49405b193b40778b Mon Sep 17 00:00:00 2001 From: James Booth Date: Mon, 18 Jul 2016 20:55:50 +0100 Subject: [PATCH] Use g_path_get_basename when installing plugin --- src/command/cmd_funcs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index a4b53bf1..d5f63846 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -6059,13 +6059,14 @@ cmd_plugins(ProfWin *window, const char *const command, gchar **args) return TRUE; } - char *plugin_name = basename(filename); + gchar *plugin_name = g_path_get_basename(filename); gboolean result = plugins_install(plugin_name, filename); if (result) { cons_show("Plugin installed: %s", plugin_name); } else { cons_show("Failed to install plugin: %s", plugin_name); } + g_free(plugin_name); return TRUE; } else if (g_strcmp0(args[0], "load") == 0) {