This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Typos in bucomm.c


On Thu, Jan 11, 2007 at 12:22:30PM -0800, H. J. Lu wrote:
> Hi Alan,
> 
> Your patch:
> 
> http://sourceware.org/ml/binutils/2007-01/msg00109.html
> 
> won't compile if HAVE_DOS_BASED_FILE_SYSTEM is defined. There are
> 
> #ifdef HAVE_DOS_BASED_FILE_SYSTEM
>   {
>     /* We could have foo/bar\\baz, or foo\\bar, or d:bar.  */
>     char *bslash = strrchr (path, '\\');
> 
>     if (slash == NULL || (bslash != NULL && bslash > slash))
>       slash = bslash;
>     if (slash == NULL && path[0] != '\0' && path[1] == ':')
>       slash = filename + 1;
>   }
> #endif
> 
> But filename is never defined.
> 

This patch works for me.


H.J.
---
2007-01-11  H.J. Lu <hjl@gnu.org>

	* bucomm.c (template_in_dir): Fix typo.

--- binutils/bucomm.c.path	2007-01-10 17:45:25.000000000 -0800
+++ binutils/bucomm.c	2007-01-11 12:29:41.000000000 -0800
@@ -394,7 +394,7 @@ static char *
 template_in_dir (const char *path)
 {
 #define template "stXXXXXX"
-  char *slash = strrchr (path, '/');
+  const char *slash = strrchr (path, '/');
   char *tmpname;
   size_t len;
 
@@ -406,7 +406,7 @@ template_in_dir (const char *path)
     if (slash == NULL || (bslash != NULL && bslash > slash))
       slash = bslash;
     if (slash == NULL && path[0] != '\0' && path[1] == ':')
-      slash = filename + 1;
+      slash = path + 1;
   }
 #endif
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]