Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Test-Strict CPAN distribution.

Report information
The Basics
Id: 42575
Status: resolved
Priority: 0/
Queue: Test-Strict

People
Owner: Nobody in particular
Requestors: perl [...] renee-baecker.de
Cc:
AdminCc:

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



Subject: Problems when path to script/module contains whitespaces
Date: Tue, 20 Jan 2009 20:14:59 +0100
To: bug-Test-Strict [...] rt.cpan.org
From: Renée Bäcker <perl [...] renee-baecker.de>
Hi, I had some problems with this module as this calls "perl -c $script" (e.g. perl -c C:\Test and Test\script.pl) if the path to the script contains whitespaces perl complains that there is no perl script "and". Perl can't know that the path contains whitespaces. The same with the directories that are added to @INC via the -I switch. Attached is a patch that fixes these issues. Cheers, Renee
--- Strict.pm.orig 2009-01-20 20:09:20.000000000 +0100 +++ Strict.pm 2009-01-20 19:52:38.000000000 +0100 @@ -165,13 +165,13 @@ return; } - my $inc = join(' -I ', @INC) || ''; + my $inc = join(' -I ', map{ "\"$_\""}@INC) || ''; $inc = "-I $inc" if $inc; $file = _untaint($file); my $perl_bin = _untaint($PERL); local $ENV{PATH} = _untaint($ENV{PATH}) if $ENV{PATH}; - my $eval = `$perl_bin $inc -c $file 2>&1`; + my $eval = `$perl_bin $inc -c \"$file\" 2>&1`; $file = quotemeta($file); my $ok = $eval =~ qr!$file syntax OK!ms; $Test->ok($ok, $test_txt); @@ -340,7 +340,7 @@ } foreach my $file ( @all_files ) { $file = _untaint($file); - `$perl_bin -MDevel::Cover=$DEVEL_COVER_OPTIONS $file 2>&1 > /dev/null`; + `$perl_bin -MDevel::Cover=$DEVEL_COVER_OPTIONS "$file" 2>&1 > /dev/null`; $Test->ok(! $?, "Coverage captured from $file" ); } $Test->ok(my $cover = `$cover_bin 2>/dev/null`, "Got cover");
New version 0.12 released to CPAN, should also work better with Devel::Cover on Windows