From b7c0311103f53e1873547fbbb88c6abd41678e7a Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Sun, 25 Feb 2018 18:27:20 +0000 Subject: [PATCH] contrib/pre-commit: update tag-counting (Forum #84939) git-svn-id: https://svn.fhem.de/fhem/trunk@16267 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/pre-commit | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fhem/contrib/pre-commit b/fhem/contrib/pre-commit index 9d0ddc893..2084359fd 100755 --- a/fhem/contrib/pre-commit +++ b/fhem/contrib/pre-commit @@ -12,7 +12,7 @@ my $arg="-t $txn"; #my $arg="-r $txn"; # local testing my @lang = ("EN", "DE"); my $exitCode = 0; -use constant TAGS => qw{ul li code b i u td tr table div}; +use constant TAGS => qw{ul li code b i u table tr td div h4 h3}; my $log = `$svnlook log $arg $repos`; if($log !~ m/^.*:.*$/s) { @@ -124,7 +124,11 @@ foreach my $row (split("\n", $fList)) { foreach $tag (TAGS) { my $ot = ($tagcount{$tag} ? $tagcount{$tag} : 0); $tagcount{$tag} +=()= ($l =~ /<$tag>/gi); - $tagcount{$tag} -=()= ($l =~ /<\/$tag>/gi) if($tagcount{$tag} > 0); + $tagcount{$tag} -=()= ($l =~ /<\/$tag>/gi); + if($tagcount{$tag} < 0) { + print "*** $lang $fPath: negative tagcount for $tag, line $line\n"; + $tagcount{$tag} = 0; + } $llwct{$tag} = $line if(!$llwct{$tag} || ($ot && !$tagcount{$tag})); } }