From a2a45ad20ce3cc5fff2d86ea34b939d66768a7f7 Mon Sep 17 00:00:00 2001 From: Josh Cunningham Date: Wed, 26 Jun 2024 12:24:56 -0500 Subject: [PATCH 1/2] Update Formulation_Manager.hpp to use boost regex --- include/realizations/catchment/Formulation_Manager.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/realizations/catchment/Formulation_Manager.hpp b/include/realizations/catchment/Formulation_Manager.hpp index 9a1a61ea3a..e8a6d317cb 100644 --- a/include/realizations/catchment/Formulation_Manager.hpp +++ b/include/realizations/catchment/Formulation_Manager.hpp @@ -9,8 +9,8 @@ #include #include #include -#include +#include #include #include #include @@ -410,7 +410,7 @@ namespace realization { } // Create a regular expression used to identify proper file names - std::regex pattern(filepattern); + boost::regex pattern(filepattern); // A stream providing the functions necessary for evaluating a directory: // https://www.gnu.org/software/libc/manual/html_node/Opening-a-Directory.html#Opening-a-Directory @@ -463,7 +463,7 @@ namespace realization { if (directory != nullptr) { bool match; while ((entry = readdir(directory))) { - match = std::regex_match(entry->d_name, pattern); + match = boost::regex_match(entry->d_name, pattern); if( match ) { // If the entry is a regular file or symlink AND the name matches the pattern, // we can consider this ready to be interpretted as valid forcing data (even if it isn't) From 201c071c7cfeffb569bd8728bd1af26d4e7bc397 Mon Sep 17 00:00:00 2001 From: Josh Cunningham Date: Wed, 26 Jun 2024 16:38:25 -0500 Subject: [PATCH 2/2] Update include/realizations/catchment/Formulation_Manager.hpp Co-authored-by: Phil Miller - NOAA --- include/realizations/catchment/Formulation_Manager.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/realizations/catchment/Formulation_Manager.hpp b/include/realizations/catchment/Formulation_Manager.hpp index e8a6d317cb..651b99fdbb 100644 --- a/include/realizations/catchment/Formulation_Manager.hpp +++ b/include/realizations/catchment/Formulation_Manager.hpp @@ -463,8 +463,7 @@ namespace realization { if (directory != nullptr) { bool match; while ((entry = readdir(directory))) { - match = boost::regex_match(entry->d_name, pattern); - if( match ) { + if (filepattern == entry->d_name || boost::regex_match(entry->d_name, pattern)) { // If the entry is a regular file or symlink AND the name matches the pattern, // we can consider this ready to be interpretted as valid forcing data (even if it isn't) #ifdef _DIRENT_HAVE_D_TYPE