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..)
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;