aboutsummaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-09-19 23:51:01 -0700
committerJunio C Hamano <gitster@pobox.com>2008-09-19 23:51:01 -0700
commitcd0843198fecf9faa6e82f6db15fc9c7ec31d3f4 (patch)
treea249a3382129dfa4aa572af0e7ce1fe44c5bac9c /diff.c
parentdde4af4313c6fba5269df384d97ef4fa3ab5971d (diff)
parent6a6baf9b4e819a0bbfd70627f966cd7144dd8301 (diff)
downloadgit-cd0843198fecf9faa6e82f6db15fc9c7ec31d3f4.tar.gz
git-cd0843198fecf9faa6e82f6db15fc9c7ec31d3f4.tar.xz
Merge branch 'bc/maint-diff-hunk-header-fix' into bc/master-diff-hunk-header-fix
* bc/maint-diff-hunk-header-fix: diff: use extended regexp to find hunk headers Conflicts: diff.c
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/diff.c b/diff.c
index 7b24672d3..5b9b07485 100644
--- a/diff.c
+++ b/diff.c
@@ -1404,23 +1404,26 @@ static const struct funcname_pattern_entry *funcname_pattern(const char *ident)
}
static const struct funcname_pattern_entry builtin_funcname_pattern[] = {
- { "bibtex", "\\(@[a-zA-Z]\\{1,\\}[ \t]*{\\{0,1\\}[ \t]*[^ \t\"@',\\#}{~%]*\\).*$", 0 },
+ { "bibtex", "(@[a-zA-Z]{1,}[ \t]*\{{0,1}[ \t]*[^ \t\"@',\\#}{~%]*).*$",
+ REG_EXTENDED },
{ "html", "^\\s*\\(<[Hh][1-6]\\s.*>.*\\)$", 0 },
- { "java", "!^[ ]*\\(catch\\|do\\|for\\|if\\|instanceof\\|"
- "new\\|return\\|switch\\|throw\\|while\\)\n"
- "^[ ]*\\(\\([ ]*"
- "[A-Za-z_][A-Za-z_0-9]*\\)\\{2,\\}"
- "[ ]*([^;]*\\)$", 0 },
- { "pascal", "^\\(\\(procedure\\|function\\|constructor\\|"
- "destructor\\|interface\\|implementation\\|"
- "initialization\\|finalization\\)[ \t]*.*\\)$"
- "\\|"
- "^\\(.*=[ \t]*\\(class\\|record\\).*\\)$",
- 0 },
+ { "java",
+ "!^[ \t]*(catch|do|for|if|instanceof|new|return|switch|throw|while)\n"
+ "^[ \t]*(([ \t]*[A-Za-z_][A-Za-z_0-9]*){2,}[ \t]*\\([^;]*)$",
+ REG_EXTENDED },
+ { "pascal",
+ "^((procedure|function|constructor|destructor|interface|"
+ "implementation|initialization|finalization)[ \t]*.*)$"
+ "|"
+ "^(.*=[ \t]*(class|record).*)$",
+ REG_EXTENDED },
{ "php", "^[\t ]*\\(\\(function\\|class\\).*\\)", 0 },
{ "python", "^\\s*\\(\\(class\\|def\\)\\s.*\\)$", 0 },
- { "ruby", "^\\s*\\(\\(class\\|module\\|def\\)\\s.*\\)$", 0 },
- { "tex", "^\\(\\\\\\(\\(sub\\)*section\\|chapter\\|part\\)\\*\\{0,1\\}{.*\\)$", 0 },
+ { "ruby", "^[ \t]*((class|module|def)[ \t].*)$",
+ REG_EXTENDED },
+ { "tex",
+ "^(\\\\((sub)*section|chapter|part)\\*{0,1}\{.*)$",
+ REG_EXTENDED },
};
static const struct funcname_pattern_entry *diff_funcname_pattern(struct diff_filespec *one)