From 80b03d6cb9eed713fb09f78682a45151e37c0518 Mon Sep 17 00:00:00 2001 From: mfr69bs Date: Thu, 31 Jan 2013 20:06:55 +0000 Subject: [PATCH] fixed uninitialized values, added binmode to update git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@2619 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_notice.pm | 2 +- fhem/FHEM/98_update.pm | 15 ++++++++++++--- fhem/FHEM/FhemUtils/update-20130127-001 | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/fhem/FHEM/98_notice.pm b/fhem/FHEM/98_notice.pm index ead6e341f..0f541105b 100644 --- a/fhem/FHEM/98_notice.pm +++ b/fhem/FHEM/98_notice.pm @@ -500,7 +500,7 @@ notice_Confirmation($$$) my ($noticeDir,$id,$confirmation) = @_; my @file; my $confirmed = 0; - my $oldConfirmation; + my $oldConfirmation = ""; my $dateTime; my $now = TimeNow(); my $ret; diff --git a/fhem/FHEM/98_update.pm b/fhem/FHEM/98_update.pm index 5c4035196..a10a3d841 100644 --- a/fhem/FHEM/98_update.pm +++ b/fhem/FHEM/98_update.pm @@ -150,10 +150,18 @@ update_CheckNotice($) my $moddir = "$modpath/FHEM"; my $noticeDir = "$moddir/FhemUtils"; my $ret; + my $result; - my @published = split(",",AnalyzeCommandChain(undef, "notice get update 6")); - my @unconfirmed = split(",",AnalyzeCommandChain(undef, "notice get update 7")); - my @confirmed = split(",",AnalyzeCommandChain(undef, "notice get update 8")); + my @published; + my @unconfirmed; + my @confirmed; + + $result = AnalyzeCommandChain(undef, "notice get update 6"); + @published = split(",",$result) if($result); + $result = AnalyzeCommandChain(undef, "notice get update 7"); + @unconfirmed = split(",",$result) if($result); + $result = AnalyzeCommandChain(undef, "notice get update 8"); + @confirmed = split(",",$result) if($result); # remove confirmed from published my %c; @@ -621,6 +629,7 @@ update_GetRemoteFiles($$$) next if ($mkdir); if (open (FH, ">$localFile")) { + binmode FH; print FH $fileContent; close (FH); Log 5, "update write $localFile"; diff --git a/fhem/FHEM/FhemUtils/update-20130127-001 b/fhem/FHEM/FhemUtils/update-20130127-001 index 4cc8a3175..5e98bda66 100644 --- a/fhem/FHEM/FhemUtils/update-20130127-001 +++ b/fhem/FHEM/FhemUtils/update-20130127-001 @@ -5,7 +5,7 @@ # EXPIRE: 0 # POSITION: before # KEY_1: sendStatistics -# VAL_1: AttrVal("global","sendStatistics",undef); +# VAL_1: AttrVal("global","sendStatistics",""); # CON_1: !empty # TITLE_DE: Das FHEM-Projekt moechte Dich um Deine Unterstuetzung bitten! # NOTICE_DE