From de7763e5559ad4b6d44f6fbfa116904d44ef118c Mon Sep 17 00:00:00 2001 From: eidheim Date: Sun, 17 Sep 2023 17:22:08 +0200 Subject: [PATCH] Fixed CMake and Meson project detection for dos newlines --- src/cmake.cpp | 2 +- src/meson.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmake.cpp b/src/cmake.cpp index 22fd0f5..caad5da 100644 --- a/src/cmake.cpp +++ b/src/cmake.cpp @@ -18,7 +18,7 @@ CMake::CMake(const boost::filesystem::path &path) { if(input) { std::string line; while(std::getline(input, line)) { - const static std::regex project_regex("^ *project *\\(.*$", std::regex::icase | std::regex::optimize); + const static std::regex project_regex("^ *project *\\(.*\r?$", std::regex::icase | std::regex::optimize); std::smatch sm; if(std::regex_match(line, sm, project_regex)) return true; diff --git a/src/meson.cpp b/src/meson.cpp index 9ef1754..0b6e484 100644 --- a/src/meson.cpp +++ b/src/meson.cpp @@ -17,7 +17,7 @@ Meson::Meson(const boost::filesystem::path &path) { if(input) { std::string line; while(std::getline(input, line)) { - const static std::regex project_regex("^ *project *\\(.*", std::regex::icase | std::regex::optimize); + const static std::regex project_regex("^ *project *\\(.*\r?$", std::regex::icase | std::regex::optimize); std::smatch sm; if(std::regex_match(line, sm, project_regex)) return true;