Integrate perlio:
[p5sagit/p5-mst-13.2.git] / win32 / perlhost.h
index 7fcd534..815be84 100644 (file)
@@ -1594,6 +1594,14 @@ PerlProcPopen(struct IPerlProc* piPerl, const char *command, const char *mode)
     return win32_popen(command, mode);
 }
 
+PerlIO*
+PerlProcPopenList(struct IPerlProc* piPerl, const char *mode, IV narg, SV **args)
+{
+    dTHXo;
+    PERL_FLUSHALL_FOR_CHILD;
+    return win32_popenlist(mode, narg, args);
+}
+
 int
 PerlProcPclose(struct IPerlProc* piPerl, PerlIO *stream)
 {
@@ -1893,7 +1901,8 @@ struct IPerlProc perlProc =
     PerlProcSpawn,
     PerlProcSpawnvp,
     PerlProcASpawn,
-    PerlProcLastHost
+    PerlProcLastHost,
+    PerlProcPopenList
 };
 
 
@@ -2185,10 +2194,10 @@ CPerlHost::GetChildDir(void)
     New(0, ptr, MAX_PATH+1, char);
     if(ptr) {
        m_pvDir->GetCurrentDirectoryA(MAX_PATH+1, ptr);
-       length = strlen(ptr)-1;
-       if(length > 0) {
-           if((ptr[length] == '\\') || (ptr[length] == '/'))
-               ptr[length] = 0;
+       length = strlen(ptr);
+       if (length > 3) {
+           if ((ptr[length-1] == '\\') || (ptr[length-1] == '/'))
+               ptr[length-1] = 0;
        }
     }
     return ptr;