From acdcba54b3f4384c81be314a92a7042669fbfabd Mon Sep 17 00:00:00 2001 From: Alann-Mints <105276921+Alann-Mints@users.noreply.github.com> Date: Fri, 17 Feb 2023 22:21:00 +0000 Subject: [PATCH 1/4] Update fm.h Fixed: https://github.com/aldostools/IRISMAN/issues/75 (both things). --- fm_exFAT/include/fm.h | 1 - 1 file changed, 1 deletion(-) diff --git a/fm_exFAT/include/fm.h b/fm_exFAT/include/fm.h index f773e4e..6e45769 100644 --- a/fm_exFAT/include/fm.h +++ b/fm_exFAT/include/fm.h @@ -12,7 +12,6 @@ typedef enum { FS_TNTFS, FS_TEXT, FS_TFAT, - FS_TRETURN, } FS_TYPE; struct fm_file { From a0698bd9078e240581d91e99aaa94099b351fdab Mon Sep 17 00:00:00 2001 From: Alann-Mints <105276921+Alann-Mints@users.noreply.github.com> Date: Fri, 17 Feb 2023 22:21:49 +0000 Subject: [PATCH 2/4] Update fsutil.c Fixed: https://github.com/aldostools/IRISMAN/issues/75 (both things). --- fm_exFAT/source/fsutil.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/fm_exFAT/source/fsutil.c b/fm_exFAT/source/fsutil.c index 06db5a8..397154d 100644 --- a/fm_exFAT/source/fsutil.c +++ b/fm_exFAT/source/fsutil.c @@ -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) { @@ -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: @@ -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) @@ -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)) { From 49eac2a375a9921cff2ce5523747993b31227e3f Mon Sep 17 00:00:00 2001 From: Alann-Mints <105276921+Alann-Mints@users.noreply.github.com> Date: Fri, 17 Feb 2023 22:22:25 +0000 Subject: [PATCH 3/4] Update fm.c Fixed: https://github.com/aldostools/IRISMAN/issues/75 (both things). --- fm_exFAT/source/fm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fm_exFAT/source/fm.c b/fm_exFAT/source/fm.c index d19fc9d..e05247a 100644 --- a/fm_exFAT/source/fm.c +++ b/fm_exFAT/source/fm.c @@ -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 From 13085436002754a2a4494d7d12b6abd2ad536a37 Mon Sep 17 00:00:00 2001 From: Alann-Mints <105276921+Alann-Mints@users.noreply.github.com> Date: Fri, 17 Feb 2023 23:21:25 +0000 Subject: [PATCH 4/4] Update fm.h Removed the last of the code added for old method of handling /.. --- fm_exFAT/include/fm.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/fm_exFAT/include/fm.h b/fm_exFAT/include/fm.h index 6e45769..aeb5bfd 100644 --- a/fm_exFAT/include/fm.h +++ b/fm_exFAT/include/fm.h @@ -55,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);