diff options
Diffstat (limited to 'gprof')
-rw-r--r-- | gprof/ChangeLog | 5 | ||||
-rw-r--r-- | gprof/source.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/gprof/ChangeLog b/gprof/ChangeLog index deec805..400c834 100644 --- a/gprof/ChangeLog +++ b/gprof/ChangeLog @@ -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. diff --git a/gprof/source.c b/gprof/source.c index 039e876..dd671d5 100644 --- a/gprof/source.c +++ b/gprof/source.c @@ -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; |