Canonicalize folders when setting up assemblies_path
authorAndrea Canciani <ranma42@gmail.com>
Thu, 1 May 2014 10:59:25 +0000 (12:59 +0200)
committerAndrea Canciani <ranma42@gmail.com>
Thu, 1 May 2014 19:41:44 +0000 (21:41 +0200)
When MONO_PATH contains relative folders, they are meant as relative
from where the application is launched, not from the current directory
of each assembly load.

Fixes #19380.

mono/metadata/assembly.c

index 6193f15db3bb25ddae5c10e8d68ae4406594a70a..15d60411420a0e041ea0b2fdcfaec9ea6465b01f 100644 (file)
@@ -234,20 +234,20 @@ void
 mono_set_assemblies_path (const char* path)
 {
        char **splitted, **dest;
-       
+
        splitted = g_strsplit (path, G_SEARCHPATH_SEPARATOR_S, 1000);
        if (assemblies_path)
                g_strfreev (assemblies_path);
        assemblies_path = dest = splitted;
-       while (*splitted){
-               if (**splitted)
-                       *dest++ = *splitted;
-               else
-                       g_free (*splitted);
+       while (*splitted) {
+               char *tmp = *splitted;
+               if (*tmp)
+                       *dest++ = mono_path_canonicalize (tmp);
+               g_free (tmp);
                splitted++;
        }
        *dest = *splitted;
-       
+
        if (g_getenv ("MONO_DEBUG") == NULL)
                return;