Integrate change #9116 from maintperl into mainline.
Jarkko Hietaniemi [Tue, 13 Mar 2001 01:49:41 +0000 (01:49 +0000)]
Win32::GetCwd() returns C: instead of C:\ in the root directory
under ithreads

p4raw-link: @9116 on //depot/maint-5.6/perl: 864201fef66f086d79f15d5f6659d358d38b3288

p4raw-id: //depot/perl@9119
p4raw-integrated: from //depot/maint-5.6/perl@9118 'merge in'
win32/perlhost.h (@8167..)

win32/perlhost.h

index 7fcd534..719d82a 100644 (file)
@@ -2185,10 +2185,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;