Hello libtool,

  libltdl currently segfaults on lt_dlopen(0). Patch below fixes that by
implementing dlopening self:


2000-05-03  Paul Sokolovsky  <[EMAIL PROTECTED]>

        * ltdl.c: support lt_dlopen(0) for win32

--- ltdl.c      Tue Mar 28 19:22:06 2000
+++ E:\Projects\libtool-hack\libltdl\ltdl.c     Wed May  3 18:26:14 2000
@@ -457,7 +457,16 @@ sys_wll_open (loader_data, filename)
        lt_dlhandle cur;
        lt_module_t module;
        char *searchname = 0;
-       char *ext = strrchr(filename, '.');
+       char *ext;
+        char self_name_buf[MAX_PATH];
+
+        if (!filename) {
+               /* Get the name of main module */
+               *self_name_buf = 0;
+               GetModuleFileName(NULL, self_name_buf, sizeof(self_name_buf));
+                filename = ext = self_name_buf;
+        }
+       else ext = strrchr(filename, '.');

        if (ext) {
                /* FILENAME already has an extension. */


Best regards,
 Paul                          mailto:[EMAIL PROTECTED]


Reply via email to