diff --git a/CMakeLists.txt b/CMakeLists.txt index 39fd71c..e26586d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.1.0) project(fnd CXX) -find_package(Boost 1.54 REQUIRED COMPONENTS system filesystem) +find_package(Boost 1.60 REQUIRED COMPONENTS system filesystem) include_directories( ${Boost_INCLUDE_DIR} ) file(GLOB SOURCES "src/*.cpp") diff --git a/README.md b/README.md index f7f489d..05162de 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ CMakeLists.txt ## Dependencies * g++ `>=4.9` -* boost `>=1.54` +* boost `>=1.60` ## Build ```bash diff --git a/src/fnd.cpp b/src/fnd.cpp index 4199f1d..91c026d 100644 --- a/src/fnd.cpp +++ b/src/fnd.cpp @@ -23,10 +23,8 @@ void printPath(const fs::path& path) { void findFiles(const std::regex& pattern) { const fs::path& currentPath = fs::current_path(); - fs::recursive_directory_iterator entry; - for (entry = fs::recursive_directory_iterator(currentPath); - entry != fs::recursive_directory_iterator(); ++entry) { - const fs::path& path = entry->path(); + for (auto& entry: fs::recursive_directory_iterator(currentPath)) { + const fs::path& path = entry.path().lexically_relative(currentPath); if (std::regex_search(path.string(), pattern)) { printPath(path);