fixed: skip blanks at the end of a block

git-svn-id: https://svn.fhem.de/fhem/trunk@5813 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
damian-s
2014-05-10 18:03:59 +00:00
parent 5c9e394d6d
commit 0ad2c0f356

View File

@@ -240,18 +240,18 @@ ParseCommandsIf($)
$currentBlock=$tailBlock;
$tailBlock="";
}
if ($currentBlock ne "") {
$currentBlock =~ s/'/\\'/g;
($currentBlock,$err)=ReplaceAllReadingsIf($currentBlock,1);
return ($currentBlock,$err) if ($err);
($currentBlock,$err)=EvalAllIf($currentBlock);
$currentBlock =~ s/;/;;/g;
return ($currentBlock,$err) if ($err);
$parsedCmd.="fhem('".$currentBlock."')";
if ($currentBlock =~ /[^\s]/g) {
$currentBlock =~ s/'/\\'/g;
($currentBlock,$err)=ReplaceAllReadingsIf($currentBlock,1);
return ($currentBlock,$err) if ($err);
($currentBlock,$err)=EvalAllIf($currentBlock);
$currentBlock =~ s/;/;;/g;
return ($currentBlock,$err) if ($err);
$parsedCmd.="fhem('".$currentBlock."')";
$parsedCmd.=";;" if ($tailBlock);
} else {
$parsedCmd.=";;" if ($tailBlock);
} else {
$parsedCmd.=";;" if ($tailBlock);
}
}
}
}
return($parsedCmd,"");