Index: cvsfltlib/cvsflt.cpp =================================================================== RCS file: /scotty/cvsflt/cvsfltlib/cvsflt.cpp,v retrieving revision 1.8 diff -c -r1.8 cvsflt.cpp *** cvsfltlib/cvsflt.cpp 20 Sep 2012 03:22:54 -0000 1.8 --- cvsfltlib/cvsflt.cpp 4 Oct 2012 05:15:36 -0000 *************** *** 131,154 **** { 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; ! dirlen=wcslen(dir); ! if (!bMatchedExact) bRetExact=CvsAddPosixDirectoryIntW(dir,temp); ! add_result = GetShortPathNameW(dir,NULL,add_short_len); if (add_result>0) { LPVOID add_short_str=NULL; add_short_len=add_result*sizeof(WCHAR); add_short_str = new char[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 (wcscmp(dir,(LPCWSTR)add_short_str)==0) bMatchedExact = TRUE; else bRetLong=CvsAddPosixDirectoryIntW((LPWSTR)add_short_str,temp); --- 131,175 ---- { 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; ! LPVOID dirfull=NULL; ! ! add_result = GetFullPathNameW(dir,0,NULL,NULL); ! if (add_result>0) ! { ! dirfull_len=add_result*sizeof(WCHAR); ! dirfull = new char[dirfull_len]; ! if (dirfull) ! { ! ZeroMemory(dirfull,dirfull_len); ! add_result = GetFullPathNameW(dir,add_result,(LPWSTR)dirfull,NULL); ! if (add_result==0) ! { ! delete[] dirfull; ! dirfull=NULL; ! } ! } ! } ! if (!dirfull) bRetExact=CvsAddPosixDirectoryIntW(dir,temp); ! else ! bRetExact=CvsAddPosixDirectoryIntW((LPCWSTR)dirfull,temp); ! ! // put the short version of the path into the posix directory list in the driver ! add_result = GetShortPathNameW((dirfull)?(LPWSTR)dirfull:dir,NULL,add_short_len); if (add_result>0) { LPVOID add_short_str=NULL; add_short_len=add_result*sizeof(WCHAR); add_short_str = new char[add_short_len]; if (add_short_str) { ! ZeroMemory(add_short_str,add_short_len); ! add_result = GetShortPathNameW((dirfull)?(LPWSTR)dirfull:dir,(LPWSTR)add_short_str,add_result); if (add_result>0) { ! // I don't think this should be case insensitive... ! if (wcscmp((dirfull)?(LPCWSTR)dirfull:dir,(LPCWSTR)add_short_str)==0) bMatchedExact = TRUE; else bRetLong=CvsAddPosixDirectoryIntW((LPWSTR)add_short_str,temp); *************** *** 156,174 **** delete[] add_short_str; } } ! add_result = GetLongPathNameW(dir,NULL,add_long_len); if (add_result>0) { LPVOID add_long_str=NULL; add_long_len=add_result*sizeof(WCHAR); add_long_str = new char [add_long_len]; - ZeroMemory(add_long_str,add_long_len); if (add_long_str) { ! add_result = GetLongPathNameW(dir,(LPWSTR)add_long_str,add_long_len); if (add_result>0) { ! if (wcscmp(dir,(LPCWSTR)add_long_str)==0) bMatchedExact = TRUE; else bRetShort=CvsAddPosixDirectoryIntW((LPWSTR)add_long_str,temp); --- 177,197 ---- delete[] add_short_str; } } ! // put the long version of the path into the posix directory list in the driver ! add_result = GetLongPathNameW((dirfull)?(LPCWSTR)dirfull:dir,NULL,add_long_len); if (add_result>0) { LPVOID add_long_str=NULL; add_long_len=add_result*sizeof(WCHAR); add_long_str = new char [add_long_len]; if (add_long_str) { ! ZeroMemory(add_long_str,add_long_len); ! add_result = GetLongPathNameW((dirfull)?(LPCWSTR)dirfull:dir,(LPWSTR)add_long_str,add_result); if (add_result>0) { ! // I don't think this should be case insensitive... ! if (wcscmp((dirfull)?(LPCWSTR)dirfull:dir,(LPCWSTR)add_long_str)==0) bMatchedExact = TRUE; else bRetShort=CvsAddPosixDirectoryIntW((LPWSTR)add_long_str,temp); *************** *** 176,181 **** --- 199,206 ---- delete[] add_long_str; } } + if (dirfull) + delete[] dirfull; return (bRetLong || bRetShort || bMatchedExact); }