Change 31737 by [EMAIL PROTECTED] on 2007/08/20 13:16:19

        Subject: [PATCH] Get Cwd->cwd() to work under Cygwin
        From: "Jerry D. Hedden" <[EMAIL PROTECTED]>
        Date: Wed, 15 Aug 2007 10:39:41 -0400
        Message-ID: <[EMAIL PROTECTED]>
        
        Updated patch originally by Reini Urban.

Affected files ...

... //depot/perl/cygwin/cygwin.c#19 edit
... //depot/perl/t/lib/cygwin.t#4 edit

Differences ...

==== //depot/perl/cygwin/cygwin.c#19 (text) ====
Index: perl/cygwin/cygwin.c
--- perl/cygwin/cygwin.c#18~31708~      2007-08-13 23:56:00.000000000 -0700
+++ perl/cygwin/cygwin.c        2007-08-20 06:16:19.000000000 -0700
@@ -145,7 +145,10 @@
     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));

==== //depot/perl/t/lib/cygwin.t#4 (text) ====
Index: perl/t/lib/cygwin.t
--- perl/t/lib/cygwin.t#3~31708~        2007-08-13 23:56:00.000000000 -0700
+++ perl/t/lib/cygwin.t 2007-08-20 06:16:19.000000000 -0700
@@ -9,7 +9,7 @@
     }
 }
 
-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 @@
     is($i->[2].",".$i->[3], $rootmnt, "same root mount flags");
   }
 }
+
+ok(Cwd->cwd(), "bug#38628 legacy");
End of Patch.

Reply via email to