delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/11/11/12:57:16

From: khan AT xraylith DOT wisc DOT edu (Mumit Khan)
Subject: [patch] Re: dlopen bug!
11 Nov 1998 12:57:16 -0800 :
Message-ID: <9811112017.AB18663.cygnus.cygwin32.developers@modi.xraylith.wisc.edu>

------- Blind-Carbon-Copy

To: Jorrit Tyberghein <Jorrit DOT Tyberghein AT uz DOT kuleuven DOT ac DOT be>
cc: gnu-win32 AT cygnus DOT com
Subject: [patch] Re: dlopen bug! 
In-reply-to: Your message of "Tue, 10 Nov 1998 11:56:42 +0100."
             <36481BE9 DOT 35E38846 AT uz DOT kuleuven DOT ac DOT be> 
Date: Wed, 11 Nov 1998 14:17:27 -0600
From: Mumit Khan <khan AT modi DOT xraylith DOT wisc DOT edu>

Jorrit Tyberghein <Jorrit DOT Tyberghein AT uz DOT kuleuven DOT ac DOT be> 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  <khan AT xraylith DOT wisc DOT edu>

	* 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


------- End of Blind-Carbon-Copy

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019