aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/diff
diff options
context:
space:
mode:
authorTom Jones <thj@FreeBSD.org>2022-03-01 13:23:25 +0000
committerTom Jones <thj@FreeBSD.org>2022-03-01 13:27:21 +0000
commit4be7d087c2b566f4910683836be279d55c1a81c6 (patch)
tree0c77daf7c8f1861404388cc274a4116537562dd0 /usr.bin/diff
parent3cf2f812f586da2a5e8be1e57e769741e22ac088 (diff)
downloadsrc-4be7d087c2b566f4910683836be279d55c1a81c6.tar.gz
src-4be7d087c2b566f4910683836be279d55c1a81c6.zip
diff: Use start of change when searching for function
Use the start of change when searching for a function rather than the start of the context. In short functions if this could result in search for the function name starting from before the function definition. PR: 262086 Reviewed by: bapt, mckusick, mhorne Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D34328
Diffstat (limited to 'usr.bin/diff')
-rw-r--r--usr.bin/diff/diffreg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c
index ae815aa4e01f..4fbdd3c3f50c 100644
--- a/usr.bin/diff/diffreg.c
+++ b/usr.bin/diff/diffreg.c
@@ -1462,7 +1462,7 @@ dump_context_vec(FILE *f1, FILE *f2, int flags)
printf("***************");
if (flags & (D_PROTOTYPE | D_MATCHLAST)) {
- f = match_function(ixold, lowa - 1, f1);
+ f = match_function(ixold, cvp->a - 1, f1);
if (f != NULL)
printf(" %s", f);
}
@@ -1569,7 +1569,7 @@ dump_unified_vec(FILE *f1, FILE *f2, int flags)
uni_range(lowc, upd);
printf(" @@");
if (flags & (D_PROTOTYPE | D_MATCHLAST)) {
- f = match_function(ixold, lowa - 1, f1);
+ f = match_function(ixold, cvp->a - 1, f1);
if (f != NULL)
printf(" %s", f);
}