Skip to content

Commit

Permalink
Merge pull request #89 from Alann-Mints/master
Browse files Browse the repository at this point in the history
Fixes to exFAT Manager
  • Loading branch information
aldostools authored Feb 18, 2023
2 parents a11c61f + 1308543 commit 2838641
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
3 changes: 0 additions & 3 deletions fm_exFAT/include/fm.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ typedef enum {
FS_TNTFS,
FS_TEXT,
FS_TFAT,
FS_TRETURN,
} FS_TYPE;

struct fm_file {
Expand Down Expand Up @@ -56,8 +55,6 @@ struct fm_job {
unsigned long long fsize;
};

struct fm_panel *app_active_panel ();

int fm_entry_add (struct fm_file **entries, char *fn, char dir, unsigned long fsz);
int fm_entry_pull (struct fm_file **entries);

Expand Down
1 change: 1 addition & 0 deletions fm_exFAT/source/fm.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ int fm_panel_enter (struct fm_panel *p)
char np[CBSIZE];
if (p->path)
{
if (!strncmp(p->current->name, "..", 2)/*p->current_idx == 0*/) { fm_panel_exit (p); return 0; }
if (p->current && p->current->name && *(p->current->name))
snprintf (np, CBSIZE, "%s/%s", p->path, p->current->name);
else
Expand Down
14 changes: 3 additions & 11 deletions fm_exFAT/source/fsutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,6 @@ int fs_get_fstype (char *path, int *np)
if (!path)
return FS_TNONE;

// fix paths with /..
char *up = strstr(path, "/..");
if(up) {*up = 0; up = strrchr(path, '/'); if(up) *up = 0; return FS_TRETURN;}

//FAT/ExFAT path
if (strncmp (path, "fat", 3) == 0)
{
Expand Down Expand Up @@ -388,14 +384,10 @@ int fs_path_scan (struct fm_panel *p)
return root_scan_path (p);
}

fm_panel_add (p, "..", 1, 0);
p->fs_type = fs_get_fstype (p->path, NULL);
switch (p->fs_type)
{
case FS_TRETURN:
{
fm_panel_exit ( p );
return -1;
}
//scan FAT/ExFAT path
//if (strncmp (p->path, "fat", 3) == 0)
case FS_TFAT:
Expand Down Expand Up @@ -444,7 +436,7 @@ static int sys_scan_path (struct fm_panel *p)
{
if (!read)
break;
if (!strcmp (dir.d_name, ".")) // || !strcmp (dir.d_name, ".."))
if (!strcmp (dir.d_name, ".") || !strcmp (dir.d_name, ".."))
continue;
//
if (dir.d_type & DT_DIR)
Expand Down Expand Up @@ -536,7 +528,7 @@ static int ntfs_scan_path (struct fm_panel *p)
if (ps3ntfs_dirnext (pdir, dir.d_name, &st))
break; // Break on error or end of dir
//skip parent and child listing
if (!strcmp(dir.d_name, ".")) // || !strcmp(dir.d_name, ".."))
if (!strcmp(dir.d_name, ".") || !strcmp(dir.d_name, ".."))
continue;
if (S_ISDIR(st.st_mode))
{
Expand Down

0 comments on commit 2838641

Please sign in to comment.