diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-11-07 16:39:51 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-11-07 16:39:51 +0000 |
commit | 98b36f88b0b3202c5ad5f739aaf25ee0273bfcbd (patch) | |
tree | 1ca40740ac2d1643a6d37323fe26ab04dc2ef3b3 /win32/vdir.h | |
parent | 9af0acdbd72c7cf7dd9e593b8f5d51dcf0bfa4f7 (diff) | |
download | perl-98b36f88b0b3202c5ad5f739aaf25ee0273bfcbd.tar.gz |
normalize relative paths in virtualized current directory on windows,
under ithreads (avoids ".." etc showing up in what Cwd::cwd()
returns)
p4raw-id: //depot/perl@7592
Diffstat (limited to 'win32/vdir.h')
-rw-r--r-- | win32/vdir.h | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/win32/vdir.h b/win32/vdir.h index 37cb4a580e..af769f1549 100644 --- a/win32/vdir.h +++ b/win32/vdir.h @@ -393,7 +393,7 @@ char *VDir::MapPathA(const char *pInName) /* has drive letter */ if (IsPathSep(pInName[2])) { /* absolute with drive letter */ - strcpy(szLocalBufferA, pInName); + DoGetFullPathNameA((char*)pInName, sizeof(szLocalBufferA), szLocalBufferA); } else { /* relative path with drive letter */ @@ -409,15 +409,14 @@ char *VDir::MapPathA(const char *pInName) /* no drive letter */ if (IsPathSep(pInName[1]) && IsPathSep(pInName[0])) { /* UNC name */ - strcpy(szLocalBufferA, pInName); + DoGetFullPathNameA((char*)pInName, sizeof(szLocalBufferA), szLocalBufferA); } else { strcpy(szBuffer, GetDefaultDirA()); if (IsPathSep(pInName[0])) { /* absolute path */ - szLocalBufferA[0] = szBuffer[0]; - szLocalBufferA[1] = szBuffer[1]; - strcpy(&szLocalBufferA[2], pInName); + strcpy(&szBuffer[2], pInName); + DoGetFullPathNameA(szBuffer, sizeof(szLocalBufferA), szLocalBufferA); } else { /* relative path */ @@ -620,7 +619,7 @@ WCHAR* VDir::MapPathW(const WCHAR *pInName) /* has drive letter */ if (IsPathSep(pInName[2])) { /* absolute with drive letter */ - wcscpy(szLocalBufferW, pInName); + DoGetFullPathNameW((WCHAR*)pInName, (sizeof(szLocalBufferW)/sizeof(WCHAR)), szLocalBufferW); } else { /* relative path with drive letter */ @@ -636,15 +635,14 @@ WCHAR* VDir::MapPathW(const WCHAR *pInName) /* no drive letter */ if (IsPathSep(pInName[1]) && IsPathSep(pInName[0])) { /* UNC name */ - wcscpy(szLocalBufferW, pInName); + DoGetFullPathNameW((WCHAR*)pInName, (sizeof(szLocalBufferW)/sizeof(WCHAR)), szLocalBufferW); } else { wcscpy(szBuffer, GetDefaultDirW()); if (IsPathSep(pInName[0])) { /* absolute path */ - szLocalBufferW[0] = szBuffer[0]; - szLocalBufferW[1] = szBuffer[1]; - wcscpy(&szLocalBufferW[2], pInName); + wcscpy(&szBuffer[2], pInName); + DoGetFullPathNameW(szBuffer, (sizeof(szLocalBufferW)/sizeof(WCHAR)), szLocalBufferW); } else { /* relative path */ |