gnucash stable: Multiple changes pushed
Christopher Lam
clam at code.gnucash.org
Thu May 28 05:16:14 EDT 2026
Updated via https://github.com/Gnucash/gnucash/commit/4d90f19c (commit)
via https://github.com/Gnucash/gnucash/commit/908bfc08 (commit)
from https://github.com/Gnucash/gnucash/commit/f3653213 (commit)
commit 4d90f19c7340495e6e5756e03bbf159c8c5d2430
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Wed May 27 22:41:25 2026 +0800
[csv-imp] use ctre instead of boost::regex
diff --git a/gnucash/import-export/csv-imp/gnc-imp-props-price.cpp b/gnucash/import-export/csv-imp/gnc-imp-props-price.cpp
index 65f891fa02..c70019185d 100644
--- a/gnucash/import-export/csv-imp/gnc-imp-props-price.cpp
+++ b/gnucash/import-export/csv-imp/gnc-imp-props-price.cpp
@@ -41,6 +41,7 @@
#include <boost/regex/icu.hpp>
#include <gnc-locale-utils.hpp>
#include "gnc-imp-props-price.hpp"
+#include <ctre.hpp>
namespace bl = boost::locale;
@@ -65,7 +66,8 @@ std::map<GncPricePropType, const char*> gnc_price_col_type_strs = {
GncNumeric parse_amount_price (const std::string &str, int currency_format)
{
/* If a cell is empty or just spaces return invalid amount */
- if(!boost::regex_search(str, boost::regex("[0-9]")))
+ static constexpr ctll::fixed_string digit_re{"[0-9]"};
+ if(!ctre::search<digit_re>(str))
throw std::invalid_argument (_("Value doesn't appear to contain a valid number."));
static const auto expr = boost::make_u32regex("[[:Sc:]]");
diff --git a/gnucash/import-export/csv-imp/gnc-imp-props-tx.cpp b/gnucash/import-export/csv-imp/gnc-imp-props-tx.cpp
index c53bf2fa33..e14d3b4ebb 100644
--- a/gnucash/import-export/csv-imp/gnc-imp-props-tx.cpp
+++ b/gnucash/import-export/csv-imp/gnc-imp-props-tx.cpp
@@ -47,6 +47,7 @@
#include <boost/regex/icu.hpp>
#include <gnc-locale-utils.hpp>
#include "gnc-imp-props-tx.hpp"
+#include <ctre.hpp>
namespace bl = boost::locale;
@@ -135,7 +136,8 @@ GncNumeric parse_monetary (const std::string &str, int currency_format)
return GncNumeric{};
/* Strings otherwise containing no digits will be considered invalid */
- if(!boost::regex_search(str, boost::regex("[0-9]")))
+ static constexpr ctll::fixed_string digit_re{"[0-9]"};
+ if(!ctre::search<digit_re>(str))
throw std::invalid_argument (_("Value doesn't appear to contain a valid number."));
static const auto expr = boost::make_u32regex("[[:Sc:][:blank:]]|--");
commit 908bfc080223b683a6e31f7c13994472b2145e40
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Wed May 27 22:35:46 2026 +0800
[core-utils] upgrade ctre in CMakeLists to public
so that it's available everywhere including tests
diff --git a/libgnucash/core-utils/CMakeLists.txt b/libgnucash/core-utils/CMakeLists.txt
index 3f66cf7410..21ce5acc08 100644
--- a/libgnucash/core-utils/CMakeLists.txt
+++ b/libgnucash/core-utils/CMakeLists.txt
@@ -52,12 +52,12 @@ target_include_directories(gnc-core-utils
target_link_libraries(gnc-core-utils
PUBLIC
PkgConfig::GLIB2
+ ctre
PRIVATE
${Boost_LIBRARIES}
${GOBJECT_LDFLAGS}
${GTK_MAC_LDFLAGS}
${ICU_LIBRARIES}
- ctre
"$<$<BOOL:${MAC_INTEGRATION}>:${OSX_EXTRA_LIBRARIES}>")
target_compile_definitions(gnc-core-utils
Summary of changes:
gnucash/import-export/csv-imp/gnc-imp-props-price.cpp | 4 +++-
gnucash/import-export/csv-imp/gnc-imp-props-tx.cpp | 4 +++-
libgnucash/core-utils/CMakeLists.txt | 2 +-
3 files changed, 7 insertions(+), 3 deletions(-)
More information about the gnucash-changes
mailing list