[#26715] Blender2.57 crash when opening in Windows, non-latin char in path
authorCampbell Barton <ideasman42@gmail.com>
Fri, 6 May 2011 01:03:36 +0000 (01:03 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 6 May 2011 01:03:36 +0000 (01:03 +0000)
this isn't a fix but GetModuleFileName is returning a name that doesn't exist, so finding python after this isn't working.

Show a popup that the path has an invalid name so at least the user can move it.

source/blender/blenlib/intern/path_util.c

index e8e8127..1f4b0ff 100644 (file)
@@ -1692,6 +1692,10 @@ void BLI_where_am_i(char *fullname, const size_t maxlen, const char *name)
 #ifdef _WIN32
        if(GetModuleFileName(0, fullname, maxlen)) {
                GetShortPathName(fullname, fullname, maxlen);
+               if(!BLI_exists(fullname)) {
+                       printf("path can't be found: \"%.*s\"\n", maxlen, fullname);
+                       MessageBox(NULL, "path constains invalid characters or is too long (see console)", "Error", MB_OK);
+               }
                return;
        }
 #endif