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:
@@ -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,"");
|
||||
|
||||
Reference in New Issue
Block a user