OS-X start_process

* Add App recognition
pull/4/head
David Freese 2016-01-19 21:41:35 -06:00
rodzic f5e3186dd8
commit ebc00ed17d
1 zmienionych plików z 10 dodań i 0 usunięć

Wyświetl plik

@ -222,6 +222,16 @@ void start_process(string executable)
CloseHandle(pi.hThread);
free(cmd);
#else
#ifdef __APPLE__
if (executable.find(".app") == (executable.length() - 4)) {
std::string progname = executable;
size_t p = progname.find("/", 1);
if (p != std::string::npos) progname.erase(0,p+1);
p = progname.find("-");
if (p != std::string::npos) progname.erase(p);
executable.append("/Contents/MacOS/").append(progname);
}
#endif
switch (fork()) {
case -1:
LOG_PERROR("fork");