2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

Some more error checking

git-svn-id: https://svn.fhem.de/fhem/trunk@2498 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2013-01-12 21:11:54 +00:00
parent 3f7c19ebb1
commit bb6a0028d9

View File

@ -65,16 +65,18 @@ foreach my $lang (@lang) {
open(MOD, $mods{$mod}) || die("Cant open $mods{$mod}:$!\n");
my $skip = 1;
my $line = 0;
my $docCount = 0;
while(my $l = <MOD>) {
$line++;
if($l =~ m/^=begin html$suffix/) {
if($l =~ m/^=begin html$suffix$/) {
$l = <MOD>; # skip one line, to be able to repeat join+split
$skip = 0; $line++;
} elsif($l =~ m/^=end html$suffix/) {
} elsif($l =~ m/^=end html$suffix$/) {
$skip = 1;
} elsif(!$skip) {
# here we copy line by line from the module
print OUT $l;
$docCount++;
foreach $tag (TAGS) {
my $ot = ($tagcount{$tag} ? $tagcount{$tag} : 0);
$tagcount{$tag} +=()= ($l =~ /<$tag>/gi);
@ -85,6 +87,7 @@ foreach my $lang (@lang) {
}
}
close(MOD);
print "$mod: No document text found\n" if(!$suffix && !$docCount);
foreach $tag (TAGS) {
print("$lang $mods{$mod}: Unbalanced $tag ".
"($tagcount{$tag}, last line ok: $llwct{$tag})\n")