Actually submit previous change.
[p5sagit/p5-mst-13.2.git] / ext / Cwd / Cwd.xs
index 00ebcc7..039adb9 100644 (file)
@@ -70,9 +70,7 @@ static char *rcsid = "$OpenBSD: realpath.c,v 1.4 1998/05/18 09:55:19 deraadt Exp
  */
 static
 char *
-bsd_realpath(path, resolved)
-       const char *path;
-       char *resolved;
+bsd_realpath(const char *path, char *resolved)
 {
 #ifdef VMS
        dTHX;
@@ -270,7 +268,7 @@ int Perl_getcwd_sv(pTHX_ register SV *sv)
     }
 
 #else
-
+  {
     Stat_t statbuf;
     int orig_cdev, orig_cino, cdev, cino, odev, oino, tdev, tino;
     int namelen, pathlen=0;
@@ -382,6 +380,7 @@ int Perl_getcwd_sv(pTHX_ register SV *sv)
     }
 
     return TRUE;
+  }
 #endif
 
 #else
@@ -410,6 +409,19 @@ PPCODE:
 }
 
 void
+getcwd(...)
+PROTOTYPE: DISABLE
+PPCODE:
+{
+    dXSTARG;
+    getcwd_sv(TARG);
+    XSprePUSH; PUSHTARG;
+#ifndef INCOMPLETE_TAINTS
+    SvTAINTED_on(TARG);
+#endif
+}
+
+void
 abs_path(pathsv=Nullsv)
     SV *pathsv
 PROTOTYPE: DISABLE
@@ -419,7 +431,7 @@ PPCODE:
     char *path;
     char buf[MAXPATHLEN];
 
-    path = pathsv ? SvPV_nolen(pathsv) : ".";
+    path = pathsv ? SvPV_nolen(pathsv) : (char *)".";
 
     if (bsd_realpath(path, buf)) {
         sv_setpvn(TARG, buf, strlen(buf));
@@ -435,7 +447,7 @@ PPCODE:
 #endif
 }
 
-#ifdef WIN32
+#if defined(WIN32) && !defined(UNDER_CE)
 
 void
 getdcwd(...)