about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2016-07-18 20:55:50 +0100
committerJames Booth <boothj5@gmail.com>2016-07-18 20:55:50 +0100
commitd4b3a05678d149051f5c2bbd49405b193b40778b (patch)
tree6c99fc071838cb54881360749d2b7a05fb93eada /src
parent10814b044d0d3ab9b85afb64dfdb9abe6d2c1656 (diff)
downloadprofani-tty-d4b3a05678d149051f5c2bbd49405b193b40778b.tar.gz
Use g_path_get_basename when installing plugin
Diffstat (limited to 'src')
-rw-r--r--src/command/cmd_funcs.c3
1 files changed, 2 insertions, 1 deletions
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) {