[qboosh@pld-linux.org: dllwrap: bug in deduce_name()]

H. J. Lu hjl@lucon.org
Sat Jul 31 19:22:00 GMT 2004


----- Forwarded message from Jakub Bogusz <qboosh@pld-linux.org> -----

X-Original-To: hjl@lucon.org
Delivered-To: hjl@localhost.lucon.org
Date: Sat, 31 Jul 2004 21:01:19 +0200
From: Jakub Bogusz <qboosh@pld-linux.org>
To: bug-binutils@gnu.org
Cc: hjl@lucon.org
Subject: dllwrap: bug in deduce_name()
User-Agent: Mutt/1.4.2.1i

(refers to current CVS and HJL version 2.15.91.0.2)

I noticed that last change in dllwrap.c (rev. 1.14 in binutils CVS)
broke deduce_name() function: two different variables (program_name
and prog_name) have been renamed to the same (name).
Now cross dllwrap run as i386-mingw32-dllwrap without --driver-name
tries to call native gcc instead of i386-mingw32-gcc.

Here is patch which fixes this problem and updates comments for
current variable names.


-- 
Jakub Bogusz    http://cyber.cs.net.pl/~qboosh/

--- binutils-2.15.91.0.2/binutils/dllwrap.c.orig	2004-07-28 06:36:09.000000000 +0200
+++ binutils-2.15.91.0.2/binutils/dllwrap.c	2004-07-31 20:23:00.454866160 +0200
@@ -253,7 +253,7 @@
 
   dash = NULL;
   slash = NULL;
-  for (cp = name; *cp != '\0'; ++cp)
+  for (cp = prog_name; *cp != '\0'; ++cp)
     {
       if (*cp == '-')
 	dash = cp;
@@ -272,17 +272,17 @@
   cmd = NULL;
 
   if (dash != NULL)
-    /* First, try looking for a prefixed PROG_NAME in the
-       PROGRAM_NAME directory, with the same prefix as PROGRAM_NAME.  */
-    cmd = look_for_prog (name, name, dash - name + 1);
+    /* First, try looking for a prefixed NAME in the
+       PROG_NAME directory, with the same prefix as PROG_NAME.  */
+    cmd = look_for_prog (name, prog_name, dash - prog_name + 1);
 
   if (slash != NULL && cmd == NULL)
-    /* Next, try looking for a PROG_NAME in the same directory as
+    /* Next, try looking for a NAME in the same directory as
        that of this program.  */
-    cmd = look_for_prog (name, name, slash - name + 1);
+    cmd = look_for_prog (name, prog_name, slash - prog_name + 1);
 
   if (cmd == NULL)
-    /* Just return PROG_NAME as is.  */
+    /* Just return NAME as is.  */
     cmd = xstrdup (name);
 
   return cmd;


----- End forwarded message -----



More information about the Binutils mailing list