summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/tree.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/apps/tree.c b/apps/tree.c
index 31f436ce78..d713a2378b 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -1119,9 +1119,16 @@ static bool dirbrowse(void)
case SYS_FS_CHANGED:
if (!id3db) /* file browsing */
{
- /* FixMe: skip this if not in root
- and our path is still valid */
- reload_root = true; /* the dumb way */
+ if (currdir[1]) /* not in the root */
+ {
+ DIR *dir = opendir(currdir);
+ if (dir) /* path still valid */
+ {
+ closedir(dir);
+ break; /* don't reload the root */
+ }
+ }
+ reload_root = true;
}
break;
#endif