summaryrefslogtreecommitdiff
path: root/binutils/bucomm.c
diff options
context:
space:
mode:
Diffstat (limited to 'binutils/bucomm.c')
-rw-r--r--binutils/bucomm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/binutils/bucomm.c b/binutils/bucomm.c
index 76ffa60a17..86c327fd43 100644
--- a/binutils/bucomm.c
+++ b/binutils/bucomm.c
@@ -219,7 +219,7 @@ make_tempname (filename)
{
/* We could have foo/bar\\baz, or foo\\bar, or d:bar. */
char *bslash = strrchr (filename, '\\');
- if (bslash > slash)
+ if (slash == NULL || (bslash != NULL && bslash > slash))
slash = bslash;
if (slash == NULL && filename[0] != '\0' && filename[1] == ':')
slash = filename + 1;