Fix for bug #31730
[mono.git] / mono / os / win32 / util.c
index e4d9719a9c73d29ecb0ed667b2165c019a5f472a..009c93dfe8d340e955c427c8bec91b71683d98f5 100644 (file)
 void
 mono_set_rootdir (void)
 {
-       char moddir[MAXPATHLEN], *dir, *root;
+       char moddir[MAXPATHLEN], *bindir, *installdir, *root;
 
        GetModuleFileName (NULL, moddir, sizeof(moddir));
-       dir = g_path_get_dirname (moddir);
-       root = g_strconcat (dir, "/../lib", NULL);
+       bindir = g_path_get_dirname (moddir);
+       installdir = g_path_get_dirname (bindir);
+       root = g_build_path (G_DIR_SEPARATOR_S, installdir, "lib", NULL);
 
        mono_assembly_setrootdir (root);
        g_free (root);
-       g_free (dir);
+       g_free (installdir);
+       g_free (bindir);
 }