1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-26 08:11:53 +02:00

For non-OPK programs, chdir() to the app's directory as well

This commit is contained in:
Paul Cercueil 2012-10-23 16:34:01 +02:00
parent b8112d1a73
commit 0b922e97f3

View File

@ -527,13 +527,17 @@ void LinkApp::launch(const string &selectedFile, const string &selectedDir) {
exec = opkMount + exec;
}
#else
else {
#endif
//Set correct working directory
string::size_type pos = exec.rfind("/");
if (pos != string::npos) {
string wd = exec.substr(0, pos + 1);
chdir(wd.c_str());
exec = exec.substr(pos + 1);
exec = wd + exec.substr(pos + 1);
DEBUG("Changed working directory to %s\n", wd.c_str());
}
#ifdef HAVE_LIBOPK
}
#endif