Description: Remove old symlinks from ~/.pcsx/plugins/ before creating new ones If a plugin location was changed and a symlink to the old location exist in the home user directory, it must be updated. Author: Andrey Rahmatullin Forwarded: no Last-Update: 2012-06-15 diff --git a/gui/LnxMain.c b/gui/LnxMain.c index e9b042c..f4aa56f 100755 --- a/gui/LnxMain.c +++ b/gui/LnxMain.c @@ -111,12 +111,14 @@ static void ScanPlugins(gchar* scandir) { } else { /* Create a symlink from this file to the directory ~/.pcsxr/plugin */ linkname = g_build_filename (getenv("HOME"), PLUGINS_DIR, ent->d_name, NULL); + unlink(linkname); symlink(filename, linkname); /* If it's a config tool, make one in the cfg dir as well. This allows plugins with retarded cfg finding to work :- ) */ if (match(filename, "cfg.*") == 1) { linkname = g_build_filename (getenv("HOME"), PLUGINS_CFG_DIR, ent->d_name, NULL); + unlink(linkname); symlink(filename, linkname); } g_free (linkname); @@ -147,6 +149,7 @@ static void ScanBios(gchar* scandir) { } else { /* Create a symlink from this file to the directory ~/.pcsxr/plugin */ linkname = g_build_filename(getenv("HOME"), BIOS_DIR, ent->d_name, NULL); + unlink(linkname); symlink(filename, linkname); g_free(linkname);