summaryrefslogtreecommitdiff
path: root/win32/perlhost.h
diff options
context:
space:
mode:
Diffstat (limited to 'win32/perlhost.h')
-rw-r--r--win32/perlhost.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/win32/perlhost.h b/win32/perlhost.h
index 7fcd5340b4..719d82ac04 100644
--- a/win32/perlhost.h
+++ b/win32/perlhost.h
@@ -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;