fix(imgui): ensure directory listing is platform-independent

This commit is contained in:
moonpower
2025-11-23 14:02:37 +03:00
parent 69e68a5827
commit 3adcb3acfb
+6 -2
View File
@@ -313,8 +313,12 @@ static bool list_directory(const std::string& cwd, std::vector<std::pair<std::st
if (name == ".")
continue;
// include .. for navigation
std::string full = cwd + "/" + name;
bool dir_flag = (dent->d_type == DT_DIR) || ((dent->d_type == DT_UNKNOWN) && is_directory(full));
std::string full = cwd + "/" + name;
#if defined(_WIN32)
bool dir_flag = is_directory(full);
#else
bool dir_flag = (dent->d_type == DT_DIR) || ((dent->d_type == DT_UNKNOWN) && is_directory(full));
#endif
entries.emplace_back(full, dir_flag);
}
closedir(dir);