aboutsummaryrefslogtreecommitdiff
path: root/bfd/archive.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2000-06-20 12:33:21 +0000
committerAlan Modra <amodra@gmail.com>2000-06-20 12:33:21 +0000
commit2ab47eed68c82a9a6d055ba3f49ca6a8a1dd2575 (patch)
treef16dbfc601991f71c0177a7027479b3d3e3f9247 /bfd/archive.c
parentb305ef96a167be657a95d273db6945fe7597e937 (diff)
downloadfsf-binutils-gdb-2ab47eed68c82a9a6d055ba3f49ca6a8a1dd2575.zip
fsf-binutils-gdb-2ab47eed68c82a9a6d055ba3f49ca6a8a1dd2575.tar.gz
fsf-binutils-gdb-2ab47eed68c82a9a6d055ba3f49ca6a8a1dd2575.tar.bz2
Correct pointer comparisons relying on NULL less than any other pointer.
Alexander Aganichev's fix for ieee.c
Diffstat (limited to 'bfd/archive.c')
-rw-r--r--bfd/archive.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bfd/archive.c b/bfd/archive.c
index 5709f26..6fe5997 100644
--- a/bfd/archive.c
+++ b/bfd/archive.c
@@ -1188,7 +1188,7 @@ normalize (abfd, file)
{
/* We could have foo/bar\\baz, or foo\\bar, or d:bar. */
char *bslash = strrchr (file, '\\');
- if (bslash > filename)
+ if (filename == NULL || (bslash != NULL && bslash > filename))
filename = bslash;
if (filename == NULL && file[0] != '\0' && file[1] == ':')
filename = file + 1;
@@ -1581,7 +1581,7 @@ bfd_bsd_truncate_arname (abfd, pathname, arhdr)
{
/* We could have foo/bar\\baz, or foo\\bar, or d:bar. */
char *bslash = strrchr (pathname, '\\');
- if (bslash > filename)
+ if (filename == NULL || (bslash != NULL && bslash > filename))
filename = bslash;
if (filename == NULL && pathname[0] != '\0' && pathname[1] == ':')
filename = pathname + 1;
@@ -1632,7 +1632,7 @@ bfd_gnu_truncate_arname (abfd, pathname, arhdr)
{
/* We could have foo/bar\\baz, or foo\\bar, or d:bar. */
char *bslash = strrchr (pathname, '\\');
- if (bslash > filename)
+ if (filename == NULL || (bslash != NULL && bslash > filename))
filename = bslash;
if (filename == NULL && pathname[0] != '\0' && pathname[1] == ':')
filename = pathname + 1;