From 75c3b6b2e8a72239fa23e039c46f9a5cf8c24142 Mon Sep 17 00:00:00 2001 From: Philippe Blain Date: Wed, 12 Aug 2020 22:30:29 +0000 Subject: userdiff: improve Fortran xfuncname regex The third part of the Fortran xfuncname regex wants to match the beginning of a subroutine or function, so it allows for all characters except `'`, `"` or whitespace before the keyword 'function' or 'subroutine'. This is meant to match the 'recursive', 'elemental' or 'pure' keywords, as well as function return types, and to prevent matches inside strings. However, the negated set does not contain the `!` comment character, so a line with an end-of-line comment containing the keyword 'function' or 'subroutine' followed by another word is mistakenly chosen as a hunk header. Improve the regex by adding `!` to the negated set. Signed-off-by: Philippe Blain Signed-off-by: Junio C Hamano --- t/t4018/fortran-comment-keyword | 1 - 1 file changed, 1 deletion(-) (limited to 't/t4018') diff --git a/t/t4018/fortran-comment-keyword b/t/t4018/fortran-comment-keyword index c5dbdb4c61..e9206a5379 100644 --- a/t/t4018/fortran-comment-keyword +++ b/t/t4018/fortran-comment-keyword @@ -8,7 +8,6 @@ real funcB ! grid function b real ChangeMe - integer broken end subroutine RIGHT -- cgit v1.2.3