summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry D. Hedden <jdhedden@cpan.org>2007-08-15 06:39:41 -0400
committerSteve Peters <steve@fisharerojo.org>2007-08-20 13:16:19 +0000
commit482150a7b7fa28a4cdcbe9eb32bbd0a420918766 (patch)
treeacbcd597c1ca58e0dc6387ed3972cefc2bd8bde4
parent938aad412ad7b32d5a6a132b25ca095433d86c14 (diff)
downloadperl-482150a7b7fa28a4cdcbe9eb32bbd0a420918766.tar.gz
Get Cwd->cwd() to work under Cygwin
From: "Jerry D. Hedden" <jdhedden@cpan.org> Message-ID: <1ff86f510708150739q18fa5863s55010b538d11f77f@mail.gmail.com> Updated patch originally by Reini Urban. p4raw-id: //depot/perl@31737
-rw-r--r--cygwin/cygwin.c5
-rw-r--r--t/lib/cygwin.t4
2 files changed, 7 insertions, 2 deletions
diff --git a/cygwin/cygwin.c b/cygwin/cygwin.c
index 84915f811e..60d7d9488d 100644
--- a/cygwin/cygwin.c
+++ b/cygwin/cygwin.c
@@ -145,7 +145,10 @@ XS(Cygwin_cwd)
dXSARGS;
char *cwd;
- if(items != 0)
+ /* See http://rt.perl.org/rt3/Ticket/Display.html?id=38628
+ There is Cwd->cwd() usage in the wild, and previous versions didn't die.
+ */
+ if(items > 1)
Perl_croak(aTHX_ "Usage: Cwd::cwd()");
if((cwd = getcwd(NULL, -1))) {
ST(0) = sv_2mortal(newSVpv(cwd, 0));
diff --git a/t/lib/cygwin.t b/t/lib/cygwin.t
index 3623f9a0bc..7f2f655bc7 100644
--- a/t/lib/cygwin.t
+++ b/t/lib/cygwin.t
@@ -9,7 +9,7 @@ BEGIN {
}
}
-use Test::More tests => 14;
+use Test::More tests => 15;
is(Cygwin::winpid_to_pid(Cygwin::pid_to_winpid($$)), $$,
"perl pid translates to itself");
@@ -59,3 +59,5 @@ for $i (@mnttbl) {
is($i->[2].",".$i->[3], $rootmnt, "same root mount flags");
}
}
+
+ok(Cwd->cwd(), "bug#38628 legacy");