mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-23 02:11:54 +02:00
For non-OPK programs, chdir() to the app's directory as well
This commit is contained in:
parent
b8112d1a73
commit
0b922e97f3
@ -527,13 +527,17 @@ void LinkApp::launch(const string &selectedFile, const string &selectedDir) {
|
|||||||
exec = opkMount + exec;
|
exec = opkMount + exec;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
else {
|
||||||
|
#endif
|
||||||
//Set correct working directory
|
//Set correct working directory
|
||||||
string::size_type pos = exec.rfind("/");
|
string::size_type pos = exec.rfind("/");
|
||||||
if (pos != string::npos) {
|
if (pos != string::npos) {
|
||||||
string wd = exec.substr(0, pos + 1);
|
string wd = exec.substr(0, pos + 1);
|
||||||
chdir(wd.c_str());
|
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
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user