diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2006-04-21 19:15:52 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2006-04-21 19:15:52 (GMT) |
commit | b2b2e68c37644983cbdf8552f2be3125551c6452 (patch) | |
tree | fee9b99852cc2b490d344cf8748e157b2aaff322 /Source/kwsys/SystemTools.cxx | |
parent | 4e4ae3624bc18bfe33158047e6f7fc5b3b7d2b5c (diff) | |
download | CMake-b2b2e68c37644983cbdf8552f2be3125551c6452.zip CMake-b2b2e68c37644983cbdf8552f2be3125551c6452.tar.gz CMake-b2b2e68c37644983cbdf8552f2be3125551c6452.tar.bz2 |
ENH: performance improvments
Diffstat (limited to 'Source/kwsys/SystemTools.cxx')
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index b68a9bf..eb5bc83 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -2652,11 +2652,6 @@ int OldWindowsGetLongPath(kwsys_stl::string const& shortPath, int PortableGetLongPathName(const char* pathIn, kwsys_stl::string & longPath) { - kwsys_stl::string shortPath; - if(!SystemTools::GetShortPath(pathIn, shortPath)) - { - return 0; - } HMODULE lh = LoadLibrary("Kernel32.dll"); if(lh) { @@ -2666,7 +2661,7 @@ int PortableGetLongPathName(const char* pathIn, typedef DWORD (WINAPI * GetLongFunctionPtr) (LPCSTR,LPSTR,DWORD); GetLongFunctionPtr func = (GetLongFunctionPtr)proc; char buffer[MAX_PATH+1]; - int len = (*func)(shortPath.c_str(), buffer, MAX_PATH+1); + int len = (*func)(pathIn, buffer, MAX_PATH+1); if(len == 0 || len > MAX_PATH+1) { FreeLibrary(lh); @@ -2678,7 +2673,7 @@ int PortableGetLongPathName(const char* pathIn, } FreeLibrary(lh); } - return OldWindowsGetLongPath(shortPath.c_str(), longPath); + return OldWindowsGetLongPath(pathIn, longPath); } #endif @@ -2790,7 +2785,11 @@ SystemTools::JoinPath(const kwsys_stl::vector<kwsys_stl::string>& components) bool SystemTools::ComparePath(const char* c1, const char* c2) { #if defined(_WIN32) || defined(__APPLE__) - return SystemTools::Strucmp(c1, c2) == 0; +# ifdef _MSC_VER + return _stricmp(c1, c2) == 0; +# elif defined(__APPLE__) || defined(__GNUC__) + return strcasecmp(c1, c2) == 0; +# endif #else return strcmp(c1, c2) == 0; #endif |