commit e6435d8f03f5310b07425d7d0acee7f0b8f52d8c from: Stefan Sperling date: Sat Oct 17 14:37:41 2020 UTC search for prototypes above, not at, the first line touched by the diff chunk commit - 13e2caa3edcc68a62e29b4d5503254cd5bf80b2b commit + e6435d8f03f5310b07425d7d0acee7f0b8f52d8c blob - 5101e49206dbcf9bfcd8df71242aec39ed8f57a0 blob + 56fa5047632143a80c4e6c2514162e5a9dc18f88 --- lib/diff_output.c +++ lib/diff_output.c @@ -255,12 +255,12 @@ diff_output_match_function_prototype(char **prototype, *prototype = NULL; - if (result->left.atoms.len > 0) { + if (result->left.atoms.len > 0 && cc->left.start > 0) { data = &result->left; - start_atom = &data->atoms.head[cc->left.start]; - } else if (result->right.atoms.len > 0) { + start_atom = &data->atoms.head[cc->left.start - 1]; + } else if (result->right.atoms.len > 0 && cc->right.start > 0) { data = &result->right; - start_atom = &data->atoms.head[cc->right.start]; + start_atom = &data->atoms.head[cc->right.start - 1]; } else return DIFF_RC_OK;