aboutsummaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-09-19 23:52:49 -0700
committerJunio C Hamano <gitster@pobox.com>2008-09-19 23:52:49 -0700
commit1883a0d3b7ad7c9de1ac790bda6f1a6181237439 (patch)
tree1d9875ee590e3432779adbba0cfafa65dd667fa8 /diff.c
parentcd0843198fecf9faa6e82f6db15fc9c7ec31d3f4 (diff)
downloadgit-1883a0d3b7ad7c9de1ac790bda6f1a6181237439.tar.gz
git-1883a0d3b7ad7c9de1ac790bda6f1a6181237439.tar.xz
diff: use extended regexp to find hunk headers
Using ERE elements such as "|" (alternation) by backquoting in BRE is a GNU extension and should not be done in portable programs. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/diff.c b/diff.c
index 5b9b07485..a73301017 100644
--- a/diff.c
+++ b/diff.c
@@ -1406,7 +1406,7 @@ 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\"@',\\#}{~%]*).*$",
REG_EXTENDED },
- { "html", "^\\s*\\(<[Hh][1-6]\\s.*>.*\\)$", 0 },
+ { "html", "^[ \t]*(<[Hh][1-6][ \t].*>.*)$", REG_EXTENDED },
{ "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]*\\([^;]*)$",
@@ -1417,8 +1417,8 @@ static const struct funcname_pattern_entry builtin_funcname_pattern[] = {
"|"
"^(.*=[ \t]*(class|record).*)$",
REG_EXTENDED },
- { "php", "^[\t ]*\\(\\(function\\|class\\).*\\)", 0 },
- { "python", "^\\s*\\(\\(class\\|def\\)\\s.*\\)$", 0 },
+ { "php", "^[\t ]*((function|class).*)", REG_EXTENDED },
+ { "python", "^[ \t]*((class|def)[ \t].*)$", REG_EXTENDED },
{ "ruby", "^[ \t]*((class|module|def)[ \t].*)$",
REG_EXTENDED },
{ "tex",