Commit 9b88042a authored by DailyShana's avatar DailyShana Committed by mercury233

update setting working directory (#2140)

parent b2996052
...@@ -35,11 +35,15 @@ int main(int argc, char* argv[]) { ...@@ -35,11 +35,15 @@ int main(int argc, char* argv[]) {
#endif //__APPLE__ #endif //__APPLE__
#ifdef _WIN32 #ifdef _WIN32
#ifndef _DEBUG #ifndef _DEBUG
char* pstrext;
if(argc == 2 && (pstrext = strrchr(argv[1], '.'))
&& (!mystrncasecmp(pstrext, ".ydk", 4) || !mystrncasecmp(pstrext, ".yrp", 4))) {
wchar_t exepath[MAX_PATH]; wchar_t exepath[MAX_PATH];
GetModuleFileNameW(NULL, exepath, MAX_PATH); GetModuleFileNameW(NULL, exepath, MAX_PATH);
wchar_t* p = wcsrchr(exepath, '\\'); wchar_t* p = wcsrchr(exepath, '\\');
*p = '\0'; *p = '\0';
SetCurrentDirectoryW(exepath); SetCurrentDirectoryW(exepath);
}
#endif //_DEBUG #endif //_DEBUG
#endif //_WIN32 #endif //_WIN32
#ifdef _WIN32 #ifdef _WIN32
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment