Skip to content

Commit 37e7793

Browse files
trastgitster
authored andcommitted
userdiff: allow * between cpp funcname words
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 87b5054 commit 37e7793

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

userdiff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ PATTERNS("cpp",
7474
/* Jump targets or access declarations */
7575
"!^[ \t]*[A-Za-z_][A-Za-z_0-9]*:.*$\n"
7676
/* C/++ functions/methods at top level */
77-
"^([A-Za-z_][A-Za-z_0-9]*([ \t]+[A-Za-z_][A-Za-z_0-9]*([ \t]*::[ \t]*[^[:space:]]+)?){1,}[ \t]*\\([^;]*)$\n"
77+
"^([A-Za-z_][A-Za-z_0-9]*([ \t*]+[A-Za-z_][A-Za-z_0-9]*([ \t]*::[ \t]*[^[:space:]]+)?){1,}[ \t]*\\([^;]*)$\n"
7878
/* compound type at top level */
7979
"^((struct|class|enum)[^;]*)$",
8080
/* -- */

0 commit comments

Comments
 (0)