Subject: | Use of uninitialized value $valueFragments[0] in join |
When you have a line like:
LOCATION:
(note the empty value) in the ics file, you get the warning:
Use of uninitialized value $valueFragments[0] in join or string at
/usr/share/perl5/Tie/iCal.pm line 548, <$fh> line 866.
Attached patch checks for this condition and replaces the undef value in
@valueFragments with an empty string.
Kind regards, ska
Subject: | tie-ical__empty-body.patch |
--- /tmp/iCal.pm 2013-01-04 13:58:15.544972766 +0100
+++ /usr/share/perl5/Tie/iCal.pm 2013-01-04 13:55:54.224977162 +0100
@@ -538,10 +538,13 @@
$e{$name} = [{%params}, @values];
}
} elsif ($contentLine =~ /^[\w-]+:.*$/s) { # we don't have params
my ($name, @valueFragments) = &parse_line(':', $contentLine);
my @values;
+ if(scalar(@valueFragments) == 1 && !defined($valueFragments[0])) {
+ $valueFragments[0] = '';
+ }
if ($name eq 'RRULE') {
my @params = &parse_line(';', join(':', @valueFragments));
my %params = map { my ($p, $v) = split(/=/, $_); $p => $v =~ /,/ ? [split(/,/,$v)] : $v } @params;
push @values, {%params};
} else {