Date:2013-07-19 17:54:09 (4 years 11 months ago)
Author:Paul Cercueil
Commit:04d9d9322d965e30d4bb02e45dc6ce02c5c3fd53
Message:Remove trailing slash from CARD_ROOT

Files: src/browsedialog.cpp (1 diff)
src/gmenu2x.cpp (2 diffs)
src/gmenu2x.h (1 diff)
src/menu.cpp (1 diff)

Change Details

src/browsedialog.cpp
5353        return false;
5454
5555    string path = fl->getPath();
56    if (path.empty() || !fileExists(path) || path.compare(0, CARD_ROOT_LEN, CARD_ROOT) != 0)
56    if (path.empty() || !fileExists(path) || path.compare(0,
57                    strlen(CARD_ROOT), CARD_ROOT) != 0)
5758        setPath(CARD_ROOT);
5859
5960    fl->browse();
src/gmenu2x.cpp
9595#ifdef _CARD_ROOT
9696const char *CARD_ROOT = _CARD_ROOT;
9797#elif defined(PLATFORM_A320) || defined(PLATFORM_GCW0)
98const char *CARD_ROOT = "/media/";
98const char *CARD_ROOT = "/media";
9999#else
100const char *CARD_ROOT = "/card/"; //Note: Add a trailing /!
100const char *CARD_ROOT = "/card";
101101#endif
102const int CARD_ROOT_LEN = strlen(CARD_ROOT)-1;
103102
104103static GMenu2X *app;
105104static string gmenu2x_home;
...... 
614613    btnContextMenu.setAction(MakeDelegate(this, &GMenu2X::contextMenu));
615614
616615    if (!fileExists(CARD_ROOT))
617        CARD_ROOT = "/";
616        CARD_ROOT = "";
618617
619618    while (!quit) {
620619        tickNow = SDL_GetTicks();
src/gmenu2x.h
4545const int LOOP_DELAY = 30000;
4646
4747extern const char *CARD_ROOT;
48extern const int CARD_ROOT_LEN;
4948
5049// Note: Keep this in sync with colorNames!
5150enum color {
src/menu.cpp
6363                if (dptr->d_type != DT_DIR)
6464                    continue;
6565
66                string path = (string) CARD_ROOT + dptr->d_name + "/apps";
66                string path = (string) CARD_ROOT + "/" + dptr->d_name + "/apps";
6767                if (access(path.c_str(), F_OK))
6868                    continue;
6969

Archive Download the corresponding diff file



interactive