aboutsummaryrefslogtreecommitdiff
path: root/binutils/ar.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 /binutils/ar.c
parentb305ef96a167be657a95d273db6945fe7597e937 (diff)
downloadbinutils-2ab47eed68c82a9a6d055ba3f49ca6a8a1dd2575.zip
binutils-2ab47eed68c82a9a6d055ba3f49ca6a8a1dd2575.tar.gz
binutils-2ab47eed68c82a9a6d055ba3f49ca6a8a1dd2575.tar.bz2
Correct pointer comparisons relying on NULL less than any other pointer.
Alexander Aganichev's fix for ieee.c
Diffstat (limited to 'binutils/ar.c')
-rw-r--r--binutils/ar.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/binutils/ar.c b/binutils/ar.c
index cc8b77a..650092f 100644
--- a/binutils/ar.c
+++ b/binutils/ar.c
@@ -307,10 +307,10 @@ normalize (file, abfd)
{
/* 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;
+ filename = file + 1;
}
#endif
if (filename != (char *) NULL)
@@ -392,7 +392,7 @@ main (argc, argv)
{
/* We could have foo/bar\\baz, or foo\\bar, or d:bar. */
char *bslash = strrchr (program_name, '\\');
- if (bslash > temp)
+ if (temp == NULL || (bslash != NULL && bslash > temp))
temp = bslash;
if (temp == NULL && program_name[0] != '\0' && program_name[1] == ':')
temp = program_name + 1;