summaryrefslogtreecommitdiff
path: root/source/gui.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/gui.c')
-rw-r--r--source/gui.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/source/gui.c b/source/gui.c
index b8b5c75..375fc74 100644
--- a/source/gui.c
+++ b/source/gui.c
@@ -59,7 +59,7 @@ typedef struct
static FSEL_File fsel[FSEL_MAX_FILES];
-char last_dir[FILENAME_MAX] = "/3DS/";
+char last_dir[FILENAME_MAX] = "sdmc:/";
static void CheckPath(char *path)
@@ -176,13 +176,12 @@ static int LoadDir(const char *path, const char *filter)
{
DIR *dir;
struct dirent *ent;
- struct stat st;
int no = 0;
char whole_path[FILENAME_MAX];
if ((dir = opendir(path)))
{
- if (strcmp(path, "/") != 0)
+ if (strcmp(path, "sdmc:/") != 0)
{
strcpy(fsel[no].name, "..");
fsel[no].is_dir = TRUE;
@@ -196,13 +195,11 @@ static int LoadDir(const char *path, const char *filter)
strcat(whole_path, "/");
strcat(whole_path, ent->d_name);
- stat(whole_path, &st);
-
- if (ValidFilename(ent->d_name, (st.st_mode & S_IFDIR), filter))
+ if (ValidFilename(ent->d_name, ent->d_type & DT_DIR, filter))
{
strcpy(fsel[no].name,ent->d_name);
- fsel[no].is_dir = (st.st_mode & S_IFDIR);
- fsel[no].size = (int)st.st_size;
+ fsel[no].is_dir = ent->d_type & DT_DIR;
+ fsel[no].size = 0;
no++;
}
}