2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

fhem.pl: fix perlSyntaxCheckRelated problems, +workaround for perseParams bug (Forum #52242)

git-svn-id: https://svn.fhem.de/fhem/trunk@13496 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2017-02-23 20:23:38 +00:00
parent e0ac37abff
commit accc428d69

View File

@ -4,7 +4,7 @@
# #
# Copyright notice # Copyright notice
# #
# (c) 2005-2015 # (c) 2005-2017
# Copyright: Rudolf Koenig (r dot koenig at koeniglich dot de) # Copyright: Rudolf Koenig (r dot koenig at koeniglich dot de)
# All rights reserved # All rights reserved
# #
@ -3065,7 +3065,11 @@ EvalSpecials($%)
# $EVENT will be replaced with the whole event string # $EVENT will be replaced with the whole event string
# $EVTPART<N> will be replaced with single words of an event # $EVTPART<N> will be replaced with single words of an event
my ($exec, %specials)= @_; my ($exec, %specials)= @_;
if($specials{__UNIQUECMD__}) {
delete $specials{__UNIQUECMD__};
} else {
$exec = SemicolonEscape($exec); $exec = SemicolonEscape($exec);
}
my $idx = 0; my $idx = 0;
if(defined($specials{"%EVENT"})) { if(defined($specials{"%EVENT"})) {
@ -4807,8 +4811,10 @@ perlSyntaxCheck($%)
return undef if(!$psc || !$init_done); return undef if(!$psc || !$init_done);
my ($arr, $hash) = parseParams($exec, ';'); my ($arr, $hash) = parseParams($exec, ';');
$arr = [ $exec ] if(!@$arr); # temporary bugfix
for my $cmd (@{$arr}) { for my $cmd (@{$arr}) {
next if($cmd !~ m/^\s*{/); # } for match next if($cmd !~ m/^\s*{/); # } for match
$specials{__UNIQUECMD__}=1;
$cmd = EvalSpecials("{return undef; $cmd}", %specials); $cmd = EvalSpecials("{return undef; $cmd}", %specials);
my $r = AnalyzePerlCommand(undef, $cmd); my $r = AnalyzePerlCommand(undef, $cmd);
return $r if($r); return $r if($r);