This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Typos in bucomm.c
- From: "H. J. Lu" <hjl at lucon dot org>
- To: amodra at bigpond dot net dot au
- Cc: binutils at sources dot redhat dot com
- Date: Thu, 11 Jan 2007 12:32:49 -0800
- Subject: Re: Typos in bucomm.c
- References: <20070111202230.GA30315@lucon.org>
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