Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/mcu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1404,21 +1404,23 @@ int main(int argc, char *argv[])

#if __linux__
char self_path[PATH_MAX];
char self_path_absolute[PATH_MAX];
memset(&self_path[0], 0, PATH_MAX);
memset(&self_path_absolute[0], 0, PATH_MAX);

if(readlink("/proc/self/exe", self_path, PATH_MAX) == -1)
basePath = Files::real_dirname(argv[0]);
basePath = Files::real_dirname(realpath(argv[0], self_path_absolute));
else
basePath = Files::dirname(self_path);
basePath = Files::dirname(realpath(self_path, self_path_absolute));
#else
basePath = Files::real_dirname(argv[0]);
#endif

printf("Base path is: %s\n", argv[0]);

if(Files::dirExists(basePath + "/../share/nuked-sc55"))
basePath += "/../share/nuked-sc55";

printf("Base path is: %s\n", basePath.c_str());

if (autodetect)
{
for (size_t i = 0; i < ROM_SET_COUNT; i++)
Expand Down