summaryrefslogtreecommitdiff
path: root/src/lookup.cc
diff options
context:
space:
mode:
authorTaylor R Campbell <campbell+ledger@mumble.net>2024-04-27 19:54:23 +0000
committerJohn Wiegley <johnw@newartisans.com>2024-08-06 14:51:38 -1000
commitd9967c2638052730c6eeb1624586d633d6482003 (patch)
treef6dd9d0a94cc633f4e1a4f0588c2cb613e0100e2 /src/lookup.cc
parent762353945a744ae4b89970b9e08c2c22a52ddbff (diff)
downloadfork-ledger-d9967c2638052730c6eeb1624586d633d6482003.tar.gz
fork-ledger-d9967c2638052730c6eeb1624586d633d6482003.tar.bz2
fork-ledger-d9967c2638052730c6eeb1624586d633d6482003.zip
Avoid ctype abuse.
fix https://github.com/ledger/ledger/issues/2338 fix https://github.com/ledger/ledger/issues/2340
Diffstat (limited to 'src/lookup.cc')
-rw-r--r--src/lookup.cc8
1 files changed, 7 insertions, 1 deletions
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<unsigned char>(value_key[pos - 1]))))
addend++;
#else
// jww (2010-03-07): Not yet implemented