New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
do'.\dir\file' fails under -T (Win32) #9661
Comments
From ch.l.ngre@online.deCreated by ch.l.ngre@online.deTo: perlbug@perl.org This is a bug report for perl from ch.l.ngre@online.de, ----------------------------------------------------------------- Dear porters, I came across a somewhat strange behavior of 'do()' on strawberry-perl When running under -T, Testcase attached, output as follows: E:\devel\ngre>perl test-do.pl E:\devel\ngre>perl -T test-do.pl I know, the build of perl I am running is a bit 'outdated'. I posted Best regards, Christoph Perl Info
|
From ch.l.ngre@online.deDear porters, below are patches to pp_ctl.c and t/run/switcht.t which pass tests on WinXP Regards, Christoph Lamprecht C:\devel\perl-5.10.0-mod>perl.exe -V Characteristics of this binary (from libperl): Inline Patch--- perl-5.10.0/pp_ctl.c 2007-12-18 11:47:08.000000000 +0100
+++ perl-5.10.0-mod/pp_ctl.c 2009-04-02 16:22:52.515625000 +0200
@@ -4783,10 +4783,17 @@
S_path_is_absolute(const char *name)
{
if (PERL_FILE_IS_ABSOLUTE(name)
#ifdef MACOS_TRADITIONAL
|| (*name == ':')
+#endif
+#ifdef WIN32
+ || (*name == '.' && ((name[1] == '/' ||
+ (name[1] == '.' && name[2] == '/'))
+ || (name[1] == '\\' ||
+ ( name[1] == '.' && name[2] == '\\')))
+ )
#else
|| (*name == '.' && (name[1] == '/' ||
(name[1] == '.' && name[2] == '/')))
#endif
)
--- perl-5.10.0/t/run/switcht.t 2007-12-18 11:47:08.000000000 +0100
+++ perl-5.10.0-mod/t/run/switcht.t 2009-04-02 16:04:46.796875000 +0200
@@ -4,11 +4,11 @@
chdir 't';
@INC = '../lib';
require './test.pl';
}
-plan tests => 11;
+plan tests => 13;
my $Perl = which_perl();
my $warning;
local $SIG{__WARN__} = sub { $warning = join "\n", @_; };
@@ -41,5 +41,25 @@
like( $warning, qr/^Insecure dependency in unlink $Tmsg/,
'unlink() taint warn' );
ok( !-e $file, 'unlink worked' );
ok( !$^W, "-t doesn't enable regular warnings" );
+
+
+mkdir('tt');
+open(FH,'>','tt/ttest.pl')or DIE $!;
+print FH 'return 42';
+close FH or DIE $!;
+
+my $test;
+SKIP: {
+ ($^O eq 'MSWin32') || skip('skip tainted do test with \ seperator');
+ $test = 0;
+ $test = do '.\tt/ttest.pl';
+ is($test, 42, 'Could "do" .\tt/ttest.pl');
+}
+
+$test = 0;
+$test = do './tt/ttest.pl';
+is($test, 42, 'Could "do" ./tt/ttest.pl');
+
+unlink ('./tt/ttest.pl');
+rmdir ('tt'); |
From @janduboisPatches submitted in change 36f064b |
@jandubois - Status changed from 'new' to 'resolved' |
Migrated from rt.perl.org#63492 (status was 'resolved')
Searchable as RT63492$
The text was updated successfully, but these errors were encountered: