The cpp pattern, used for C and C++, would not match the start of a declaration such as
static char *prepare_index(int argc,
because it did not allow for * anywhere between the various words that constitute the modifiers, type and function name. Fix it.
Signed-off-by: Thomas Rast <trast@student.ethz.ch> ---
This is a really sneaky one-character bug that I cannot believe went unnoticed for so long, seeing as there are plenty of instances within git itself where it matters.
userdiff.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to userdiff.c +1 −1
diff --git a/userdiff.c b/userdiff.c index 7c983c1..76109da 100644 --- a/userdiff.c +++ b/userdiff.c @@ -118,7 +118,7 @@ /* Jump targets or access declarations */ "!^[ \t]*[A-Za-z_][A-Za-z_0-9]*:.*$\n" /* C/++ functions/methods at top level */ - "^([A-Za-z_][A-Za-z_0-9]*([ \t]+[A-Za-z_][A-Za-z_0-9]*([ \t]*::[ \t]*[^[:space:]]+)?){1,}[ \t]*\\([^;]*)$\n" + "^([A-Za-z_][A-Za-z_0-9]*([ \t*]+[A-Za-z_][A-Za-z_0-9]*([ \t]*::[ \t]*[^[:space:]]+)?){1,}[ \t]*\\([^;]*)$\n" /* compound type at top level */ "^((struct|class|enum)[^;]*)$", /* -- */
-- 1.7.8.424.gcb840