95_holiday.pm: avoid strange regexp bug (Forum #104184)

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@20290 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2019-10-02 20:46:32 +00:00
parent 02fa3e3405
commit 713a1bafd9

View File

@ -100,6 +100,7 @@ holiday_refresh($;$$)
$hash->{HOLIDAYFILE} = "$dir/$name.holiday";
my @foundList;
my %foundHash;
foreach my $l (@holidayfile) {
next if($l =~ m/^\s*#/);
next if($l =~ m/^\s*$/);
@ -216,7 +217,10 @@ holiday_refresh($;$$)
$found = $args[3];
}
}
push @foundList, $found if($found && !grep(m/^$found$/,@foundList));
if($found && !$foundHash{$found}) {
push @foundList, $found;
$foundHash{$found} = 1;
}
}