Index: windows-NT/posixdir/cvsflt/cvsflt.cpp =================================================================== RCS file: /cvs/cvsnt/windows-NT/posixdir/cvsflt/cvsflt.cpp,v retrieving revision 1.1.2.5.4.5 diff -c -r1.1.2.5.4.5 cvsflt.cpp *** windows-NT/posixdir/cvsflt/cvsflt.cpp 20 Sep 2012 02:20:30 -0000 1.1.2.5.4.5 --- windows-NT/posixdir/cvsflt/cvsflt.cpp 20 Sep 2012 23:03:26 -0000 *************** *** 185,223 **** { BOOL bRetShort = FALSE, bRetLong = FALSE, bRetExact=FALSE, bMatchedExact = FALSE; // create buffers for the short and long version of this name ! DWORD add_short_len=0, add_long_len=0, add_result; ! size_t dirlen; ! //StringCbLength(dir,STRSAFE_MAX_CCH * sizeof(TCHAR),&dirlen); ! try ! { ! dirlen=lstrlenW(dir); ! } ! catch (int efree2) { ! return (efree2>0)?FALSE:FALSE; } ! ! // put the user supplied version of the path into the posix directory list in the driver ! if (!bMatchedExact) bRetExact=CvsAddPosixDirectoryIntW(dir,temp); // put the short version of the path into the posix directory list in the driver try { ! add_result = GetShortPathNameW(dir,NULL,add_short_len); if (add_result>0) { PVOID add_short_str=NULL; add_short_len=add_result*sizeof(WCHAR); add_short_str = (LPVOID)GlobalAlloc(GPTR,add_short_len); - ZeroMemory(add_short_str,add_short_len); if (add_short_str) { ! add_result = GetShortPathNameW(dir,(LPWSTR)add_short_str,add_result); if (add_result>0) { //if (CompareString(LOCALE_USER_DEFAULT,NORM_IGNORECASE,(LPCWSTR)add_short_str,add_result,dir,dirlen)==CSTR_EQUAL) ! if (lstrcmpiW(dir,(LPCWSTR)add_short_str)==0) bMatchedExact = TRUE; else bRetLong=CvsAddPosixDirectoryIntW((LPWSTR)add_short_str,temp); --- 185,229 ---- { BOOL bRetShort = FALSE, bRetLong = FALSE, bRetExact=FALSE, bMatchedExact = FALSE; // create buffers for the short and long version of this name ! DWORD add_short_len=0, add_long_len=0, add_result, dirfull_len=0; ! LPWSTR dirfull=NULL; ! ! add_result = GetFullPathNameW(dir,0,NULL,NULL); ! if (add_result>0) { ! dirfull_len=add_result*sizeof(WCHAR); ! dirfull = (LPWSTR)GlobalAlloc(GPTR,dirfull_len); ! if (dirfull) ! { ! ZeroMemory(dirfull,dirfull_len); ! add_result = GetFullPathNameW(dir,add_result,(LPWSTR)dirfull,NULL); ! if (add_result==0) ! { ! GlobalFree(dirfull); ! dirfull=NULL; ! } ! } } ! if (!dirfull) bRetExact=CvsAddPosixDirectoryIntW(dir,temp); // put the short version of the path into the posix directory list in the driver try { ! add_result = GetShortPathNameW((dirfull)?dirfull:dir,NULL,add_short_len); if (add_result>0) { PVOID add_short_str=NULL; add_short_len=add_result*sizeof(WCHAR); add_short_str = (LPVOID)GlobalAlloc(GPTR,add_short_len); if (add_short_str) { ! ZeroMemory(add_short_str,add_short_len); ! add_result = GetShortPathNameW((dirfull)?dirfull:dir,(LPWSTR)add_short_str,add_result); if (add_result>0) { //if (CompareString(LOCALE_USER_DEFAULT,NORM_IGNORECASE,(LPCWSTR)add_short_str,add_result,dir,dirlen)==CSTR_EQUAL) ! if (lstrcmpiW((dirfull)?dirfull:dir,(LPCWSTR)add_short_str)==0) bMatchedExact = TRUE; else bRetLong=CvsAddPosixDirectoryIntW((LPWSTR)add_short_str,temp); *************** *** 234,253 **** // put the long version of the path into the posix directory list in the driver try { ! add_result = GetLongPathNameW(dir,NULL,add_long_len); if (add_result>0) { PVOID add_long_str=NULL; add_long_len=add_result*sizeof(WCHAR); add_long_str = (LPVOID)GlobalAlloc(GPTR,add_long_len); - ZeroMemory(add_long_str,add_long_len); if (add_long_str) { ! add_result = GetLongPathNameW(dir,(LPWSTR)add_long_str,add_result); if (add_result>0) { //if (CompareString(LOCALE_USER_DEFAULT,NORM_IGNORECASE,(LPCWSTR)add_short_str,add_result,dir,dirlen)==CSTR_EQUAL) ! if (lstrcmpiW(dir,(LPCWSTR)add_long_str)==0) bMatchedExact = TRUE; else bRetShort=CvsAddPosixDirectoryIntW((LPWSTR)add_long_str,temp); --- 240,259 ---- // put the long version of the path into the posix directory list in the driver try { ! add_result = GetLongPathNameW((dirfull)?dirfull:dir,NULL,add_long_len); if (add_result>0) { PVOID add_long_str=NULL; add_long_len=add_result*sizeof(WCHAR); add_long_str = (LPVOID)GlobalAlloc(GPTR,add_long_len); if (add_long_str) { ! ZeroMemory(add_long_str,add_long_len); ! add_result = GetLongPathNameW((dirfull)?dirfull:dir,(LPWSTR)add_long_str,add_result); if (add_result>0) { //if (CompareString(LOCALE_USER_DEFAULT,NORM_IGNORECASE,(LPCWSTR)add_short_str,add_result,dir,dirlen)==CSTR_EQUAL) ! if (lstrcmpiW((dirfull)?dirfull:dir,(LPCWSTR)add_long_str)==0) bMatchedExact = TRUE; else bRetShort=CvsAddPosixDirectoryIntW((LPWSTR)add_long_str,temp); *************** *** 261,266 **** --- 267,277 ---- return (efree2>0)?FALSE:FALSE; } + if (dirfull) + { + GlobalFree(dirfull); + dirfull=NULL; + } return (bRetLong || bRetShort || bMatchedExact); }