Skip Menu |

This queue is for tickets about the Config-ApacheFormat CPAN distribution.

Report information
The Basics
Id: 132271
Status: new
Priority: 0/
Queue: Config-ApacheFormat

People
Owner: Nobody in particular
Requestors: ppisar [...] redhat.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.2
Fixed in: (no value)



Subject: Tests emmit "Use of uninitialized value in lc" warning
When running tests with Perl 5.30.2, I can see these warnings: $ make test PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/01basic.t ....... ok t/02block.t ....... ok t/03leak.t ........ ok t/04include.t ..... 1/? Use of uninitialized value in lc at /home/test/fedora/perl-Config-ApacheFormat/Config-ApacheFormat-1.2/blib/lib/Config/ApacheFormat.pm line 586, <$fh> line 2. Use of uninitialized value in lc at /home/test/fedora/perl-Config-ApacheFormat/Config-ApacheFormat-1.2/blib/lib/Config/ApacheFormat.pm line 586, <$fh> line 2. t/04include.t ..... ok t/05autoload.t .... ok t/06validate.t .... ok t/07largeconf.t ... ok t/08error.t ....... 1/5 Use of uninitialized value in lc at /home/test/fedora/perl-Config-ApacheFormat/Config-ApacheFormat-1.2/blib/lib/Config/ApacheFormat.pm line 586, <$fh> line 2. t/08error.t ....... ok t/09includedir.t .. 1/7 Use of uninitialized value in lc at /home/test/fedora/perl-Config-ApacheFormat/Config-ApacheFormat-1.2/blib/lib/Config/ApacheFormat.pm line 586, <$fh> line 2. Use of uninitialized value in lc at /home/test/fedora/perl-Config-ApacheFormat/Config-ApacheFormat-1.2/blib/lib/Config/ApacheFormat.pm line 586, <$fh> line 4. Use of uninitialized value in lc at /home/test/fedora/perl-Config-ApacheFormat/Config-ApacheFormat-1.2/blib/lib/Config/ApacheFormat.pm line 586, <$fh> line 4. t/09includedir.t .. ok t/10fixbools.t .... ok t/11expandvars.t .. ok t/12setenvars.t ... ok All tests successful. Files=12, Tests=446, 2 wallclock secs ( 0.07 usr 0.04 sys + 1.03 cusr 0.34 csys = 1.48 CPU) Result: PASS
Dne Út 31.bře.2020 04:34:57, ppisar napsal(a): Show quoted text
> When running tests with Perl 5.30.2, I can see these warnings: >
An attached patch fixes it.
Subject: Config-ApacheFormat-1.2-Fix-a-Use-of-uninitialized-value-in-lc-warning.patch
From e36a62fbffa61a6046c435655e65775d66fa067f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> Date: Tue, 31 Mar 2020 10:39:15 +0200 Subject: [PATCH] Fix a Use of uninitialized value in lc warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CPAN RT#132271 Signed-off-by: Petr Písař <ppisar@redhat.com> --- ApacheFormat.pm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ApacheFormat.pm b/ApacheFormat.pm index 6ed500f..0430435 100644 --- a/ApacheFormat.pm +++ b/ApacheFormat.pm @@ -582,13 +582,15 @@ sub _read { for my $f (reverse @val) { # if they specified a root_directive (ServerRoot) and # it is defined, prefix that to relative paths - my $root = $self->{case_sensitive} ? $self->{root_directive} - : lc $self->{root_directive}; - if (! File::Spec->file_name_is_absolute($f) && exists $data->{$root}) { - # looks odd; but only reliable method is construct UNIX-style - # then deconstruct - my @parts = File::Spec->splitpath("$data->{$root}[0]/$f"); - $f = File::Spec->catpath(@parts); + if (defined $self->{root_directive}) { + my $root = $self->{case_sensitive} ? $self->{root_directive} : + lc $self->{root_directive}; + if (! File::Spec->file_name_is_absolute($f) && exists $data->{$root}) { + # looks odd; but only reliable method is construct UNIX-style + # then deconstruct + my @parts = File::Spec->splitpath("$data->{$root}[0]/$f"); + $f = File::Spec->catpath(@parts); + } } # this handles directory includes (i.e. will include all files in a directory) -- 2.21.1