mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 03:06:37 +00:00
Added recursion-protection
git-svn-id: https://svn.fhem.de/fhem/trunk@3271 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
71eb2407ce
commit
17e1d6b17d
@ -74,7 +74,7 @@ sub
|
||||
PrintHashJson($$)
|
||||
{
|
||||
my ($h, $lev) = @_;
|
||||
|
||||
return if($h->{PrintHashJson});
|
||||
|
||||
my $hc = keys %{$h};
|
||||
my @str;
|
||||
@ -88,7 +88,9 @@ PrintHashJson($$)
|
||||
} else {
|
||||
$str .= sprintf("%*s\"%s\": {\n", $lev, " ", $c);
|
||||
if(keys(%{$h->{$c}}) != 0) {
|
||||
$h->{PrintHashJson} = 1;
|
||||
$str .= PrintHashJson($h->{$c}, $lev+2);
|
||||
delete($h->{PrintHashJson});
|
||||
} else {
|
||||
$str .= sprintf("%*s\"null\": \"null\"\n", $lev+4, " ");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user