1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-12-28 05:53:00 +02:00

Now only allows file browsing up to /, CARD_ROOT is /card/

This commit is contained in:
bartbes 2010-08-03 17:46:34 +02:00
parent ba9af53c21
commit e9941dc4fd
3 changed files with 4 additions and 4 deletions

View File

@ -167,7 +167,7 @@ void BrowseDialog::directoryUp()
if (p == path.size() - 1)
p = path.rfind("/", p - 1);
if (p == string::npos || path.compare(0, CARD_ROOT_LEN, CARD_ROOT) != 0 || path.length() <= CARD_ROOT_LEN) {
if (p == string::npos || path.compare(0, 1, "/") != 0 || path.length() < 2) {
close = true;
result = false;
} else {

View File

@ -77,8 +77,8 @@
//#include <pnd_discovery.h>
#endif
const char *CARD_ROOT = "/"; //Note: Add a trailing /!
const int CARD_ROOT_LEN = 1;
const char *CARD_ROOT = "/card/"; //Note: Add a trailing /!
const int CARD_ROOT_LEN = 5;
using namespace std;
using namespace fastdelegate;

View File

@ -152,7 +152,7 @@ int Selector::exec(int startSelection) {
if ( gmenu2x->input[ACTION_X] ) {
if (link->getSelectorBrowser()) {
string::size_type p = dir.rfind("/", dir.size()-2);
if (p==string::npos || dir.compare(0, CARD_ROOT_LEN, CARD_ROOT) != 0 || dir.length() <= CARD_ROOT_LEN) {
if (p==string::npos || dir.compare(0, 1, "/") != 0 || dir.length() < 2) {
close = true;
result = false;
} else {