From d9967c2638052730c6eeb1624586d633d6482003 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Sat, 27 Apr 2024 19:54:23 +0000 Subject: Avoid ctype abuse. fix https://github.com/ledger/ledger/issues/2338 fix https://github.com/ledger/ledger/issues/2340 --- src/lookup.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/lookup.cc') diff --git a/src/lookup.cc b/src/lookup.cc index 228a1d31..56820e99 100644 --- a/src/lookup.cc +++ b/src/lookup.cc @@ -188,7 +188,13 @@ lookup_probable_account(const string& ident, #if 0 #if !HAVE_BOOST_REGEX_UNICODE - if (pos == 0 || (pos > 0 && !std::isalnum(value_key[pos - 1]))) + // Probably doesn't make sense with value_key as unistring, + // but this code is under #if 0 anyway, so if anyone is + // tempted to use this by changing value_key to string, let's + // avoid leaving a rake to step on. + if (pos == 0 || + (pos > 0 && + !std::isalnum(static_cast(value_key[pos - 1])))) addend++; #else // jww (2010-03-07): Not yet implemented -- cgit v1.2.3