intuit @INC pathnames from exe location only if dll location
authorGurusamy Sarathy <gsar@cpan.org>
Sat, 20 Jun 1998 02:50:35 +0000 (02:50 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Sat, 20 Jun 1998 02:50:35 +0000 (02:50 +0000)
is unknown (ensures that multiple executables will coexist)

p4raw-id: //depot/perl@1158

win32/win32.c

index 9afb0bd..68b6bb8 100644 (file)
@@ -202,7 +202,9 @@ get_emd_part(char *prev_path, char *trailing_path, ...)
     va_start(ap, trailing_path);
     strip = va_arg(ap, char *);
 
-    GetModuleFileName(GetModuleHandle(NULL), mod_name, sizeof(mod_name));
+    GetModuleFileName((w32_perldll_handle == INVALID_HANDLE_VALUE)
+                     ? GetModuleHandle(NULL)
+                     : w32_perldll_handle, mod_name, sizeof(mod_name));
     ptr = strrchr(mod_name, '\\');
     while (ptr && strip) {
         /* look for directories to skip back */