1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-09-30 01:09:27 +03:00

Execute the links directly, don't use the shell

This breaks one thing: the "params" option of the links must be
only one parameter (without spaces). The only way to actually
set this option being to edit the config files manually, it is
pretty safe to assume it will never contain two parameters.
This commit is contained in:
Paul Cercueil 2013-12-06 00:41:08 +01:00
parent 6ef3f3b190
commit 2ab44489a1

View File

@ -586,11 +586,6 @@ void LinkApp::launch(const string &selectedFile) {
INFO("Executing '%s' (%s %s)\n", title.c_str(), exec.c_str(), params.c_str());
//check if we have to quit
string command = exec;
if (!params.empty()) command += " " + params;
if (gmenu2x->confInt["outputLogs"]
#if defined(PLATFORM_A320) || defined(PLATFORM_GCW0)
&& !consoleApp
@ -642,7 +637,18 @@ void LinkApp::launch(const string &selectedFile) {
}
#endif
execlp("/bin/sh","/bin/sh", "-c", command.c_str(), NULL);
if (isOpk()) {
#ifdef HAVE_LIBOPK
execlp("opkrun", "opkrun", "-m", metadata.c_str(), opkFile.c_str(),
!params.empty() ? params.c_str() : NULL,
NULL);
#endif
} else {
execlp(exec.c_str(), exec.c_str(),
!params.empty() ? params.c_str() : NULL,
NULL);
}
//if execution continues then something went wrong and as we already called SDL_Quit we cannot continue
//try relaunching gmenu2x
gmenu2x->main();