From e6505a95f19387560e9ab83aa1ebdd2c2a7c0c42 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 25 Oct 2020 13:58:28 +0100 Subject: [PATCH] HackStudio: Include missing files in the project tree If some file is in the project but missing on disk, let's still show it in the project tree (instead of obscuring the fact that a file is missing.) --- DevTools/HackStudio/Project.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/DevTools/HackStudio/Project.cpp b/DevTools/HackStudio/Project.cpp index 94096cbef7..6c71337896 100644 --- a/DevTools/HackStudio/Project.cpp +++ b/DevTools/HackStudio/Project.cpp @@ -331,12 +331,11 @@ void Project::rebuild_tree() continue; } struct stat st; - if (lstat(path.string().characters(), &st) < 0) - continue; - - if (S_ISDIR(st.st_mode)) { - current = ¤t->find_or_create_subdirectory(part); - continue; + if (lstat(path.string().characters(), &st) == 0) { + if (S_ISDIR(st.st_mode)) { + current = ¤t->find_or_create_subdirectory(part); + continue; + } } auto file_node = adopt(*new ProjectTreeNode); file_node->name = part;