http://bugs.winehq.org/show_bug.cgi?id=22286
Summary: GetShortPathName -> GetLongPathName doesn't give back same file Product: Wine Version: unspecified Platform: x86 URL: http://cmake.org OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: kernel32 AssignedTo: wine-bugs@winehq.org ReportedBy: cjstimpson@utwire.net
Some people are using a cmake/mingw/msys/wine combination on Linux to compile/test code targeting Windows, and its currently being discussed on the cmake user's list.
CMake uses a GetShortPathName() / GetLongPathName() trick to get the actual case for a filename.
If the a directory contains these two files (from a CMake installation, but can be empty files), CMakeFortranInformation.cmake CMakeTestCXXCompiler.cmake and GetShortPathName()/GetLongPathName() is called for CMakeTestCXXCompiler.cmake, it returns the other file instead.
======
#include <windows.h> #include <stdio.h>
int main(int argc, char** argv) { if(argc < 2) { printf("Usage: %s filename\n", argv[0]); return 1; }
char buffer[MAX_PATH+1]; char buffer2[MAX_PATH+1];
GetShortPathName(argv[1], buffer, MAX_PATH+1); GetLongPathNameA(buffer, buffer2, MAX_PATH+1); printf("%s\n", buffer2);
return 0; }