* locales.c
[mono.git] / mono / metadata / image.c
index adf6b6e7c44d966e6bca4e9479a93f496ee23655..0c8ca5f9043e6a8c51652c3a35ae2442b0d2576a 100644 (file)
@@ -341,7 +341,7 @@ load_metadata_ptrs (MonoImage *image, MonoCLIImageInfo *iinfo)
                        return FALSE;
                } else {
                        g_message ("Unknown heap type: %s\n", ptr + 8);
-                       ptr += 8 + strlen (ptr) + 1;
+                       ptr += 8 + strlen (ptr + 8) + 1;
                }
                pad = ptr - image->raw_metadata;
                if (pad % 4)
@@ -762,10 +762,17 @@ do_mono_image_open (const char *fname, MonoImageOpenStatus *status)
        image = g_new0 (MonoImage, 1);
        image->ref_count = 1;
        image->f = filed;
-       image->name = g_strdup (fname);
        iinfo = g_new0 (MonoCLIImageInfo, 1);
        image->image_info = iinfo;
 
+       if (g_path_is_absolute (fname))
+               image->name = g_strdup (fname);
+       else {
+               gchar *path = g_get_current_dir ();
+               image->name = g_build_filename (path, fname, NULL);
+               g_free (path);
+       }
+
        return do_mono_image_load (image, status);
 }
 
@@ -774,9 +781,6 @@ mono_image_loaded (const char *name)
 {
        MonoImage *res;
         
-       if (strcmp (name, "corlib") == 0)
-               name = "mscorlib";
-
        EnterCriticalSection (&images_mutex);
        res = g_hash_table_lookup (loaded_images_hash, name);
        LeaveCriticalSection (&images_mutex);