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
+5
View File
@@ -45,6 +45,11 @@ std::string getLoveInResources();
**/
std::string checkDropEvents();
/**
* Returns the full path to the executable.
**/
std::string getExecutablePath();
} // osx
} // love
+8
View File
@@ -69,6 +69,14 @@ std::string checkDropEvents()
return dropstr;
}
std::string getExecutablePath()
{
@autoreleasepool
{
return std::string([NSBundle mainBundle].executablePath.UTF8String);
}
}
} // osx
} // love
+5
View File
@@ -54,6 +54,11 @@ std::string getHomeDirectory();
**/
bool openURL(const std::string &url);
/**
* Returns the full path to the executable.
**/
std::string getExecutablePath();
} // ios
} // love
+11 -2
View File
@@ -305,15 +305,24 @@ bool openURL(const std::string &url)
@autoreleasepool
{
UIApplication *app = [UIApplication sharedApplication];
NSURL *nsurl = [NSURL URLWithString:@(url.c_str())];
if ([[UIApplication sharedApplication] canOpenURL:nsurl])
success = [[UIApplication sharedApplication] openURL:nsurl];
if ([app canOpenURL:nsurl])
success = [app openURL:nsurl];
}
return success;
}
std::string getExecutablePath()
{
@autoreleasepool
{
return std::string([NSBundle mainBundle].executablePath.UTF8String);
}
}
} // ios
} // love