This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH: perl@11564] introducing perlivp
[perl5.git]
/
win32
/
vdir.h
diff --git
a/win32/vdir.h
b/win32/vdir.h
index
37cb4a5
..
2dd7e34
100644
(file)
--- 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 */
/* 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 */
}
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 */
/* 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 */
}
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 */
}
else {
/* relative path */
@@
-453,7
+452,9
@@
int VDir::SetCurrentDirectoryA(char *lpBuffer)
DWORD r = GetFileAttributesA(pPtr);
if ((r != 0xffffffff) && (r & FILE_ATTRIBUTE_DIRECTORY))
{
DWORD r = GetFileAttributesA(pPtr);
if ((r != 0xffffffff) && (r & FILE_ATTRIBUTE_DIRECTORY))
{
- SetDefaultDirA(pPtr, DriveIndex(pPtr[0]));
+ char szBuffer[(MAX_PATH+1)*2];
+ DoGetFullPathNameA(pPtr, sizeof(szBuffer), szBuffer);
+ SetDefaultDirA(szBuffer, DriveIndex(szBuffer[0]));
nRet = 0;
}
nRet = 0;
}
@@
-620,7
+621,7
@@
WCHAR* VDir::MapPathW(const WCHAR *pInName)
/* has drive letter */
if (IsPathSep(pInName[2])) {
/* absolute with drive letter */
/* 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 */
}
else {
/* relative path with drive letter */
@@
-636,15
+637,14
@@
WCHAR* VDir::MapPathW(const WCHAR *pInName)
/* no drive letter */
if (IsPathSep(pInName[1]) && IsPathSep(pInName[0])) {
/* UNC name */
/* 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 */
}
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 */
}
else {
/* relative path */
@@
-679,7
+679,9
@@
int VDir::SetCurrentDirectoryW(WCHAR *lpBuffer)
DWORD r = GetFileAttributesW(pPtr);
if ((r != 0xffffffff) && (r & FILE_ATTRIBUTE_DIRECTORY))
{
DWORD r = GetFileAttributesW(pPtr);
if ((r != 0xffffffff) && (r & FILE_ATTRIBUTE_DIRECTORY))
{
- SetDefaultDirW(pPtr, DriveIndex((char)pPtr[0]));
+ WCHAR wBuffer[(MAX_PATH+1)*2];
+ DoGetFullPathNameW(pPtr, (sizeof(wBuffer)/sizeof(WCHAR)), wBuffer);
+ SetDefaultDirW(wBuffer, DriveIndex((char)wBuffer[0]));
nRet = 0;
}
nRet = 0;
}