Skip to content

Commit

Permalink
macOS: Correct open memstick with space.
Browse files Browse the repository at this point in the history
  • Loading branch information
unknownbrackets committed Oct 20, 2021
1 parent 11eb5fa commit 690c6b6
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions SDL/SDLMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// This is quite messy due to platform-specific implementations and #ifdef's.
// If your platform is not supported, it is suggested to use Qt instead.

#include <cstdlib>
#include <unistd.h>
#include <pwd.h>

Expand Down Expand Up @@ -199,9 +200,19 @@ void OpenDirectory(const char *path) {
SHOpenFolderAndSelectItems(pidl, 0, NULL, 0);
CoTaskMemFree(pidl);
}
#elif PPSSPP_PLATFORM(MAC)
std::string command = std::string("open ") + path;
system(command.c_str());
#elif PPSSPP_PLATFORM(MAC) || (PPSSPP_PLATFORM(LINUX) && !PPSSPP_PLATFORM(ANDROID))
pid_t pid = fork();
if (pid < 0)
return;

if (pid == 0) {
#if PPSSPP_PLATFORM(MAC)
execlp("open", "open", path, nullptr);
#else
execlp("xdg-open", "xdg-open", path, nullptr);
#endif
exit(1);
}
#endif
}

Expand Down

0 comments on commit 690c6b6

Please sign in to comment.