1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-25 18:05:20 +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:
bartbes 2010-09-01 17:37:27 +02:00
parent e9941dc4fd
commit 6381674f57

View File

@ -77,7 +77,11 @@
//#include <pnd_discovery.h>
#endif
#ifdef _CARD_ROOT
const char *CARD_ROOT = _CARD_ROOT;
#else
const char *CARD_ROOT = "/card/"; //Note: Add a trailing /!
#endif
const int CARD_ROOT_LEN = 5;
using namespace std;
@ -1064,11 +1068,11 @@ void GMenu2X::options() {
if (curGlobalVolume!=confInt["globalVolume"]) setVolume(confInt["globalVolume"]);
if (lang == "English") lang = "";
if (lang != tr.lang()) tr.setLang(lang);
/*if (fileExists(CARD_ROOT) && !showRootFolder)
if (fileExists(CARD_ROOT) && !showRootFolder)
unlink(CARD_ROOT);
else if (!fileExists(CARD_ROOT) && showRootFolder)
symlink("/", CARD_ROOT);*/
//WARNING: Disabled because these functions get dangerous when run with / as CARD_ROOT
symlink("/", CARD_ROOT);
//WARNING: the above might be dangerous with CARD_ROOT set to /
writeConfig();
}
}