Subject: [patch] Re: dlopen bug!
From: [email-masked] (Mumit Khan)

12 Nov 1998 13:03:28 -0800
Message-ID: <[email-masked]>
References: <[email-masked]>
To: Jorrit Tyberghein <[email-masked]>
Cc: [email-masked]

Jorrit Tyberghein <[email-masked]> writes:
> Hi, I'm using CygWin B20 on NT4 (SP3) and I think I have found a bug
> in dlopen.

Thanks for the bug report. Here's a fix:

Wed Nov 11 14:10:01 CST 1998  Mumit Khan  <[email-masked]>

	* dlfcn.cc (get_full_path_of_dll): Reinitialize ret each time.

Index: dlfcn.cc
===================================================================
RCS file: /mounts/sdb5/src/cdk-b20/CVSROOT/b20/winsup/dlfcn.cc,v
retrieving revision 1.1.1.1
diff -u -3 -p -r1.1.1.1 dlfcn.cc
--- dlfcn.cc	1998/11/05 21:47:13	1.1.1.1
+++ dlfcn.cc	1998/11/11 20:09:31
@@ -56,7 +56,7 @@ get_full_path_of_dll (const char* str)
   if (str == 0)
     return str;
 
-  static const char *ret = 0;
+  static const char *ret;
   char buf[MAX_PATH];
   char name[MAX_PATH];
 
@@ -67,6 +67,8 @@ get_full_path_of_dll (const char* str)
   // empty string?
   if (len == 0)
     return str;
+  
+  ret = 0;				// remember that ret is static!
 
   // trailing "." => no extension
   if (str[len - 1] == '.')

Regards,
Mumit

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".