Correct pointer comparisons relying on NULL less than any other pointer.

Alexander Aganichev's fix for ieee.c
This commit is contained in:
Alan Modra
2000-06-20 12:33:21 +00:00
parent b305ef96a1
commit 2ab47eed68
10 changed files with 42 additions and 14 deletions

View File

@ -1,3 +1,8 @@
2000-06-20 Alan Modra <alan@linuxcare.com.au>
* source.c (annotate_source): Correct pointer comparison when
checking for backslashes.
2000-06-13 H.J. Lu <hjl@gnu.org>
* configure: Regenerate.

View File

@ -116,7 +116,7 @@ DEFUN (annotate_source, (sf, max_width, annote, arg),
#ifdef HAVE_DOS_BASED_FILE_SYSTEM
{
char *bslash = strrchr (sf->name, '\\');
if (bslash > name_only)
if (name_only == NULL || (bslash != NULL && bslash > name_only))
name_only = bslash;
if (name_only == NULL && sf->name[0] != '\0' && sf->name[1] == ':')
name_only = (char *)sf->name + 1;
@ -174,7 +174,7 @@ DEFUN (annotate_source, (sf, max_width, annote, arg),
#ifdef HAVE_DOS_BASED_FILE_SYSTEM
{
char *bslash = strrchr (sf->name, '\\');
if (bslash > filename)
if (filename == NULL || (bslash != NULL && bslash > filename))
filename = bslash;
if (filename == NULL && sf->name[0] != '\0' && sf->name[1] == ':')
filename = sf->name + 1;