replace startWith for Linux

This commit is contained in:
jason 2025-12-21 18:15:32 +00:00
parent 8bc030fe94
commit 65bbde5c0e

View File

@ -36,7 +36,7 @@ void ReloadDirectory(ftxui::ScreenInteractive& screen, const std::filesystem::pa
if (std::filesystem::is_directory(entry.path()) || std::filesystem::is_regular_file(entry.path())) {
std::string name = entry.path().filename().string();
if (name.starts_with("."))
if (!name.empty() && name[0] == '.') // Works in C++11, C++14, and C++17
continue; // Skip hidden files and directories
entries.push_back(std::to_string(i) + ". " + name);
clean_names.push_back(name);