2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-20 19:36:02 +00:00

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

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

View File

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