mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-25 20:51:38 +02:00
Fixed segfault when CARD_ROOT didn't exist & added _CARD_ROOT
compile-time define to set CARD_ROOT Note that you shouldn't set CARD_ROOT (or _CARD_ROOT) to /, because that might mess things up.
This commit is contained in:
parent
e9941dc4fd
commit
6381674f57
@ -77,7 +77,11 @@
|
|||||||
//#include <pnd_discovery.h>
|
//#include <pnd_discovery.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _CARD_ROOT
|
||||||
|
const char *CARD_ROOT = _CARD_ROOT;
|
||||||
|
#else
|
||||||
const char *CARD_ROOT = "/card/"; //Note: Add a trailing /!
|
const char *CARD_ROOT = "/card/"; //Note: Add a trailing /!
|
||||||
|
#endif
|
||||||
const int CARD_ROOT_LEN = 5;
|
const int CARD_ROOT_LEN = 5;
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
@ -1064,11 +1068,11 @@ void GMenu2X::options() {
|
|||||||
if (curGlobalVolume!=confInt["globalVolume"]) setVolume(confInt["globalVolume"]);
|
if (curGlobalVolume!=confInt["globalVolume"]) setVolume(confInt["globalVolume"]);
|
||||||
if (lang == "English") lang = "";
|
if (lang == "English") lang = "";
|
||||||
if (lang != tr.lang()) tr.setLang(lang);
|
if (lang != tr.lang()) tr.setLang(lang);
|
||||||
/*if (fileExists(CARD_ROOT) && !showRootFolder)
|
if (fileExists(CARD_ROOT) && !showRootFolder)
|
||||||
unlink(CARD_ROOT);
|
unlink(CARD_ROOT);
|
||||||
else if (!fileExists(CARD_ROOT) && showRootFolder)
|
else if (!fileExists(CARD_ROOT) && showRootFolder)
|
||||||
symlink("/", CARD_ROOT);*/
|
symlink("/", CARD_ROOT);
|
||||||
//WARNING: Disabled because these functions get dangerous when run with / as CARD_ROOT
|
//WARNING: the above might be dangerous with CARD_ROOT set to /
|
||||||
writeConfig();
|
writeConfig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user