From 6fd2a042d9454c6abcf4c6cce6824c4dfe0c2d3a Mon Sep 17 00:00:00 2001 From: rudolfkoenig Date: Wed, 2 Oct 2019 20:46:32 +0000 Subject: [PATCH] 95_holiday.pm: avoid strange regexp bug (Forum #104184) git-svn-id: https://svn.fhem.de/fhem/trunk@20290 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/95_holiday.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fhem/FHEM/95_holiday.pm b/fhem/FHEM/95_holiday.pm index 9f3dc8675..465a9fdcd 100644 --- a/fhem/FHEM/95_holiday.pm +++ b/fhem/FHEM/95_holiday.pm @@ -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; + } }