From c1e4f4d1d43e574efa55bdab7d82fa2a7b738a22 Mon Sep 17 00:00:00 2001 From: rudolfkoenig Date: Sat, 12 Jan 2013 21:11:54 +0000 Subject: [PATCH] Some more error checking git-svn-id: https://svn.fhem.de/fhem/trunk@2498 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/commandref_join.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fhem/contrib/commandref_join.pl b/fhem/contrib/commandref_join.pl index 61f67a9d8..2d259126d 100755 --- a/fhem/contrib/commandref_join.pl +++ b/fhem/contrib/commandref_join.pl @@ -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 = ) { $line++; - if($l =~ m/^=begin html$suffix/) { + if($l =~ m/^=begin html$suffix$/) { $l = ; # 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")