The full executable path, rather than argv[0], is now used when determining whether the executable is fused (resolves issue #1043.)

This commit is contained in:
Alex Szpakowski
2015-05-04 10:38:28 -03:00
parent 60e8cc24bf
commit 811b2db466
12 changed files with 113 additions and 10 deletions
+6 -2
View File
@@ -64,7 +64,9 @@ bool DroppedFile::open(Mode newmode)
#ifdef LOVE_WINDOWS
// make sure non-ASCII filenames work.
std::wstring modestr = to_widestr(getModeString(newmode));
file = _wfopen(to_widestr(filename).c_str(), modestr.c_str());
std::wstring wfilename = to_widestr(filename);
file = _wfopen(wfilename.c_str(), modestr.c_str());
#else
file = fopen(filename.c_str(), getModeString(newmode));
#endif
@@ -105,8 +107,10 @@ int64 DroppedFile::getSize()
#ifdef LOVE_WINDOWS
// make sure non-ASCII filenames work.
std::wstring wfilename = to_widestr(filename);
struct _stat buf;
if (_wstat(to_widestr(filename).c_str(), &buf) != 0)
if (_wstat(wfilename.c_str(), &buf) != 0)
return -1;
return (int64) buf.st_size;