Authentication-Results: name.execsw.org; dkim=pass (1024-bit key) header.d=netbsd.org header.i=@netbsd.org header.b=U5/zHs3f; dkim=pass (1024-bit key) header.d=netbsd.org header.i=@netbsd.org header.b=kRCFTuBh Received: by mail.netbsd.org (Postfix, from userid 605) id D094F84FE8; Thu, 2 May 2024 13:27:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netbsd.org; s=20240131; t=1714656442; bh=Pl5PuQIKmO++x6g4waO3FHEhjKbS1qf0+0VoCSMKVpg=; h=Date:From:Subject:To:Reply-To:List-Id:List-Unsubscribe; b=U5/zHs3fr5aOCoV2scnxILKRxuzWSg+pch3YnN8stVcuVqey1/hfSWXDXBJRIGU1M 1HRWllRzfdjNgdTJuWpgFZousLaWPAOZ2D37qxw/VOHl6B3jc1rfT3b6TrzrMcccec gJh6WuqA1JISNaBZ5+nOmJ30UvgNWQIONjgCIhpQ= Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 18A1884FE9 for ; Thu, 2 May 2024 13:27:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Authentication-Results: mail.netbsd.org (amavisd-new); dkim=pass (1024-bit key) header.d=netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id Io8bCmHE0tfQ for ; Thu, 2 May 2024 13:27:05 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id 2739D84FE8 for ; Thu, 2 May 2024 13:27:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netbsd.org; s=20240131; t=1714656425; bh=Pl5PuQIKmO++x6g4waO3FHEhjKbS1qf0+0VoCSMKVpg=; h=Date:From:Subject:To:Reply-To; b=kRCFTuBh46qVaXJ67UOuV4V5b3HNlCAYlIXtEWFIf5/Vz/Z4FXH6urIqQQ96VlLka z5gNTHy28l44ECynFvofYjicLNWtFJvPAXgryxk1LN6K4zj3AjdGCcPSXm+XSsI0c+ dAlcSmFSkP/XeTSsGodOpfl72BygAuxpdj8Iwyr4= Received: by cvs.NetBSD.org (Postfix, from userid 500) id 1F84CFA2C; Thu, 2 May 2024 13:27:05 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1714656425222480" MIME-Version: 1.0 Date: Thu, 2 May 2024 13:27:05 +0000 From: "Taylor R Campbell" Subject: CVS commit: pkgsrc/finance/ledger To: pkgsrc-changes@NetBSD.org Reply-To: riastradh@netbsd.org X-Mailer: log_accum Message-Id: <20240502132705.1F84CFA2C@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1714656425222480 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: riastradh Date: Thu May 2 13:27:05 UTC 2024 Modified Files: pkgsrc/finance/ledger: Makefile distinfo Added Files: pkgsrc/finance/ledger/patches: patch-src_amount.cc patch-src_expr.cc patch-src_format.cc patch-src_item.cc patch-src_lookup.cc patch-src_option.cc patch-src_pool.cc patch-src_report.cc patch-src_strptime.cc patch-src_textual.cc patch-src_times.cc patch-src_utils.cc patch-src_xact.cc Log Message: finance/ledger: Fix ctype abuse. To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 pkgsrc/finance/ledger/Makefile cvs rdiff -u -r1.12 -r1.13 pkgsrc/finance/ledger/distinfo cvs rdiff -u -r0 -r1.1 pkgsrc/finance/ledger/patches/patch-src_amount.cc \ pkgsrc/finance/ledger/patches/patch-src_expr.cc \ pkgsrc/finance/ledger/patches/patch-src_format.cc \ pkgsrc/finance/ledger/patches/patch-src_item.cc \ pkgsrc/finance/ledger/patches/patch-src_lookup.cc \ pkgsrc/finance/ledger/patches/patch-src_option.cc \ pkgsrc/finance/ledger/patches/patch-src_pool.cc \ pkgsrc/finance/ledger/patches/patch-src_report.cc \ pkgsrc/finance/ledger/patches/patch-src_strptime.cc \ pkgsrc/finance/ledger/patches/patch-src_textual.cc \ pkgsrc/finance/ledger/patches/patch-src_times.cc \ pkgsrc/finance/ledger/patches/patch-src_utils.cc \ pkgsrc/finance/ledger/patches/patch-src_xact.cc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1714656425222480 Content-Disposition: inline Content-Length: 23716 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/finance/ledger/Makefile diff -u pkgsrc/finance/ledger/Makefile:1.32 pkgsrc/finance/ledger/Makefile:1.33 --- pkgsrc/finance/ledger/Makefile:1.32 Thu Apr 18 17:42:17 2024 +++ pkgsrc/finance/ledger/Makefile Thu May 2 13:27:04 2024 @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.32 2024/04/18 17:42:17 adam Exp $ +# $NetBSD: Makefile,v 1.33 2024/05/02 13:27:04 riastradh Exp $ DISTNAME= ledger-3.3.2 -PKGREVISION= 4 +PKGREVISION= 5 CATEGORIES= finance MASTER_SITES= ${MASTER_SITE_GITHUB:=ledger/} GITHUB_TAG= v${PKGVERSION_NOREV} Index: pkgsrc/finance/ledger/distinfo diff -u pkgsrc/finance/ledger/distinfo:1.12 pkgsrc/finance/ledger/distinfo:1.13 --- pkgsrc/finance/ledger/distinfo:1.12 Thu Apr 18 17:42:17 2024 +++ pkgsrc/finance/ledger/distinfo Thu May 2 13:27:04 2024 @@ -1,8 +1,21 @@ -$NetBSD: distinfo,v 1.12 2024/04/18 17:42:17 adam Exp $ +$NetBSD: distinfo,v 1.13 2024/05/02 13:27:04 riastradh Exp $ BLAKE2s (ledger-3.3.2.tar.gz) = 9204b163d03fe6d2d286614a47d65317d33c8d1bca885d7f3c9447f334b57d7c SHA512 (ledger-3.3.2.tar.gz) = d5d7058f0e9a02ad1d46e6780675d446070824b321f0f4c1ea6ac0c3dd4f11f259113bc36cbc796e4bb6d0a7898d6a68a25cce639e27a2b2434eec11a612ecb0 Size (ledger-3.3.2.tar.gz) = 825274 bytes SHA1 (patch-src_CMakeLists.txt) = 8d6a16523554c98c8559702db681af6fb4f413aa +SHA1 (patch-src_amount.cc) = 245d2dfe0182ca431188c324531ac1204be902be +SHA1 (patch-src_expr.cc) = e707cbcba58a31534072ed490c9ba95f8dc4005d +SHA1 (patch-src_format.cc) = c7fe4821bc86a9126978235fa44859f84ea92989 +SHA1 (patch-src_item.cc) = 5e97a09824a04092161d8a0ca956a43ef084a03d +SHA1 (patch-src_lookup.cc) = 0140f88386a6a9bbfa82e48fca4f3555f40a03aa SHA1 (patch-src_main.cc) = 7e21f5d903e3148c184f7473d003eb2dc27581c5 +SHA1 (patch-src_option.cc) = e2fced2a03927b91afbc3b3e390b5e1d9ea09a6e +SHA1 (patch-src_pool.cc) = 69198d4961646171b85b73fbfa6920cfe4a5ac5c +SHA1 (patch-src_report.cc) = b17a06c54dd7c3b20e8219add23cf2b26095f6d7 +SHA1 (patch-src_strptime.cc) = 730ba4f65e10721ecf4a9135f3fe65d669f6cf47 SHA1 (patch-src_system.hh.in) = 2993ef00740cbaa0ba60792e421a33642b8bba6e +SHA1 (patch-src_textual.cc) = 698581b6193b39449f84ff27bc695a9b14c877c9 +SHA1 (patch-src_times.cc) = 544235432f6811f1a5c73ee72b3011709b606f17 +SHA1 (patch-src_utils.cc) = 06d8c17822a945a9d08c1122fb05f0568fdcf493 +SHA1 (patch-src_xact.cc) = 89befd42102146e7a46f92ce458a7f1bc321ce55 Added files: Index: pkgsrc/finance/ledger/patches/patch-src_amount.cc diff -u /dev/null pkgsrc/finance/ledger/patches/patch-src_amount.cc:1.1 --- /dev/null Thu May 2 13:27:05 2024 +++ pkgsrc/finance/ledger/patches/patch-src_amount.cc Thu May 2 13:27:04 2024 @@ -0,0 +1,35 @@ +$NetBSD: patch-src_amount.cc,v 1.1 2024/05/02 13:27:04 riastradh Exp $ + +Fix ctype abuse. +https://github.com/ledger/ledger/pull/2341 + +--- src/amount.cc.orig 2023-03-30 07:40:48.000000000 +0000 ++++ src/amount.cc +@@ -983,7 +983,8 @@ namespace { + std::isdigit(c) || c == '.' || c == ','); + + string::size_type len = std::strlen(buf); +- while (len > 0 && ! std::isdigit(buf[len - 1])) { ++ while (len > 0 && ++ ! std::isdigit(static_cast(buf[len - 1]))) { + buf[--len] = '\0'; + in.unget(); + } +@@ -1018,7 +1019,7 @@ bool amount_t::parse(std::istream& in, c + parse_quantity(in, quant); + + if (! in.eof() && ((n = static_cast(in.peek())) != '\n')) { +- if (std::isspace(n)) ++ if (std::isspace(static_cast(n))) + comm_flags |= COMMODITY_STYLE_SEPARATED; + + commodity_t::parse_symbol(in, symbol); +@@ -1034,7 +1035,7 @@ bool amount_t::parse(std::istream& in, c + commodity_t::parse_symbol(in, symbol); + + if (! in.eof() && ((n = static_cast(in.peek())) != '\n')) { +- if (std::isspace(static_cast(in.peek()))) ++ if (std::isspace(in.peek())) + comm_flags |= COMMODITY_STYLE_SEPARATED; + + parse_quantity(in, quant); Index: pkgsrc/finance/ledger/patches/patch-src_expr.cc diff -u /dev/null pkgsrc/finance/ledger/patches/patch-src_expr.cc:1.1 --- /dev/null Thu May 2 13:27:05 2024 +++ pkgsrc/finance/ledger/patches/patch-src_expr.cc Thu May 2 13:27:04 2024 @@ -0,0 +1,16 @@ +$NetBSD: patch-src_expr.cc,v 1.1 2024/05/02 13:27:04 riastradh Exp $ + +Fix ctype abuse. +https://github.com/ledger/ledger/pull/2341 + +--- src/expr.cc.orig 2023-03-30 07:40:48.000000000 +0000 ++++ src/expr.cc +@@ -222,7 +222,7 @@ bool merged_expr_t::check_for_single_ide + { + bool single_identifier = true; + for (const char * p = expr.c_str(); *p; ++p) +- if (! std::isalnum(*p) || *p == '_') { ++ if (! std::isalnum(static_cast(*p)) || *p == '_') { + single_identifier = false; + break; + } Index: pkgsrc/finance/ledger/patches/patch-src_format.cc diff -u /dev/null pkgsrc/finance/ledger/patches/patch-src_format.cc:1.1 --- /dev/null Thu May 2 13:27:05 2024 +++ pkgsrc/finance/ledger/patches/patch-src_format.cc Thu May 2 13:27:04 2024 @@ -0,0 +1,78 @@ +$NetBSD: patch-src_format.cc,v 1.1 2024/05/02 13:27:04 riastradh Exp $ + +Fix ctype abuse. +https://github.com/ledger/ledger/pull/2341 + +--- src/format.cc.orig 2023-03-30 07:40:48.000000000 +0000 ++++ src/format.cc +@@ -109,7 +109,7 @@ namespace { + + // Don't gobble up any whitespace + const char * base = p; +- while (p >= base && std::isspace(*p)) ++ while (p >= base && std::isspace(static_cast(*p))) + p--; + } + return expr; +@@ -183,7 +183,7 @@ format_t::element_t * format_t::parse_el + } + + std::size_t num = 0; +- while (*p && std::isdigit(*p)) { ++ while (*p && std::isdigit(static_cast(*p))) { + num *= 10; + num += static_cast(*p++ - '0'); + } +@@ -192,7 +192,7 @@ format_t::element_t * format_t::parse_el + if (*p == '.') { + ++p; + num = 0; +- while (*p && std::isdigit(*p)) { ++ while (*p && std::isdigit(static_cast(*p))) { + num *= 10; + num += static_cast(*p++ - '0'); + } +@@ -201,7 +201,7 @@ format_t::element_t * format_t::parse_el + current->min_width = current->max_width; + } + +- if (std::isalpha(*p)) { ++ if (std::isalpha(static_cast(*p))) { + bool found = false; + for (std::size_t i = 0; i < (sizeof(single_letter_mappings) / + sizeof(format_mapping_t)); i++) { +@@ -210,7 +210,7 @@ format_t::element_t * format_t::parse_el + for (const char * ptr = single_letter_mappings[i].expr; *ptr;) { + if (*ptr == '$') { + const char * beg = ++ptr; +- while (*ptr && std::isalpha(*ptr)) ++ while (*ptr && std::isalpha(static_cast(*ptr))) + ++ptr; + string::size_type klen = static_cast(ptr - beg); + string keyword(beg, 0, klen); +@@ -250,12 +250,13 @@ format_t::element_t * format_t::parse_el + throw_(format_error, _("Prior field reference, but no template")); + + p++; +- if (*p == '0' || (! std::isdigit(*p) && ++ if (*p == '0' || (! std::isdigit(static_cast(*p)) && + *p != 'A' && *p != 'B' && *p != 'C' && + *p != 'D' && *p != 'E' && *p != 'F')) + throw_(format_error, _("%$ field reference must be a digit from 1-9")); + +- int index = std::isdigit(*p) ? *p - '0' : (*p - 'A' + 10); ++ int index = std::isdigit(static_cast(*p)) ++ ? *p - '0' : (*p - 'A' + 10); + element_t * tmpl_elem = tmpl->elements.get(); + + for (int i = 1; i < index && tmpl_elem; i++) { +@@ -630,7 +631,8 @@ string format_t::truncate(const unistrin + if (adjust > 0) { + DEBUG("format.abbrev", + "Reducing segment " << ++index << " by " << adjust << " chars"); +- while (std::isspace((*x)[*i - adjust - 1]) && adjust < *i) { ++ while (std::isspace(static_cast( ++ (*x)[*i - adjust - 1])) && adjust < *i) { + DEBUG("format.abbrev", + "Segment ends in whitespace, adjusting down"); + ++adjust; Index: pkgsrc/finance/ledger/patches/patch-src_item.cc diff -u /dev/null pkgsrc/finance/ledger/patches/patch-src_item.cc:1.1 --- /dev/null Thu May 2 13:27:05 2024 +++ pkgsrc/finance/ledger/patches/patch-src_item.cc Thu May 2 13:27:04 2024 @@ -0,0 +1,17 @@ +$NetBSD: patch-src_item.cc,v 1.1 2024/05/02 13:27:04 riastradh Exp $ + +Fix ctype abuse. +https://github.com/ledger/ledger/pull/2341 + +--- src/item.cc.orig 2023-03-30 07:40:48.000000000 +0000 ++++ src/item.cc +@@ -151,7 +151,8 @@ void item_t::parse_tags(const char * p, + if (! std::strchr(p, ':')) { + if (const char * b = std::strchr(p, '[')) { + if (*(b + 1) != '\0' && +- (std::isdigit(*(b + 1)) || *(b + 1) == '=')) { ++ (std::isdigit(static_cast(*(b + 1))) || ++ *(b + 1) == '=')) { + if (const char * e = std::strchr(b, ']')) { + char buf[256]; + std::strncpy(buf, b + 1, static_cast(e - b - 1)); Index: pkgsrc/finance/ledger/patches/patch-src_lookup.cc diff -u /dev/null pkgsrc/finance/ledger/patches/patch-src_lookup.cc:1.1 --- /dev/null Thu May 2 13:27:05 2024 +++ pkgsrc/finance/ledger/patches/patch-src_lookup.cc Thu May 2 13:27:04 2024 @@ -0,0 +1,22 @@ +$NetBSD: patch-src_lookup.cc,v 1.1 2024/05/02 13:27:04 riastradh Exp $ + +Fix ctype abuse. +https://github.com/ledger/ledger/pull/2341 + +--- src/lookup.cc.orig 2023-03-30 07:40:48.000000000 +0000 ++++ src/lookup.cc +@@ -188,7 +188,13 @@ lookup_probable_account(const string& id + + #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 Index: pkgsrc/finance/ledger/patches/patch-src_option.cc diff -u /dev/null pkgsrc/finance/ledger/patches/patch-src_option.cc:1.1 --- /dev/null Thu May 2 13:27:05 2024 +++ pkgsrc/finance/ledger/patches/patch-src_option.cc Thu May 2 13:27:04 2024 @@ -0,0 +1,17 @@ +$NetBSD: patch-src_option.cc,v 1.1 2024/05/02 13:27:04 riastradh Exp $ + +Fix ctype abuse. +https://github.com/ledger/ledger/pull/2341 + +--- src/option.cc.orig 2023-03-30 07:40:48.000000000 +0000 ++++ src/option.cc +@@ -132,7 +132,8 @@ void process_environment(const char ** e + if (*q == '_') + *r++ = '-'; + else +- *r++ = static_cast(std::tolower(*q)); ++ *r++ = static_cast(std::tolower( ++ static_cast(*q))); + *r = '\0'; + + if (*q == '=') { Index: pkgsrc/finance/ledger/patches/patch-src_pool.cc diff -u /dev/null pkgsrc/finance/ledger/patches/patch-src_pool.cc:1.1 --- /dev/null Thu May 2 13:27:05 2024 +++ pkgsrc/finance/ledger/patches/patch-src_pool.cc Thu May 2 13:27:04 2024 @@ -0,0 +1,25 @@ +$NetBSD: patch-src_pool.cc,v 1.1 2024/05/02 13:27:04 riastradh Exp $ + +Fix ctype abuse. +https://github.com/ledger/ledger/pull/2341 + +--- src/pool.cc.orig 2023-03-30 07:40:48.000000000 +0000 ++++ src/pool.cc +@@ -327,13 +327,15 @@ commodity_pool_t::parse_price_directive + datetime_t datetime; + string symbol; + +- if (! no_date && std::isdigit(time_field_ptr[0])) { ++ if (! no_date && ++ std::isdigit(static_cast(time_field_ptr[0]))) { + symbol_and_price = next_element(time_field_ptr); + if (! symbol_and_price) return none; + + datetime = parse_datetime(date_field + " " + time_field_ptr); + } +- else if (! no_date && std::isdigit(date_field_ptr[0])) { ++ else if (! no_date && ++ std::isdigit(static_cast(date_field_ptr[0]))) { + symbol_and_price = time_field_ptr; + datetime = datetime_t(parse_date(date_field)); + } Index: pkgsrc/finance/ledger/patches/patch-src_report.cc diff -u /dev/null pkgsrc/finance/ledger/patches/patch-src_report.cc:1.1 --- /dev/null Thu May 2 13:27:05 2024 +++ pkgsrc/finance/ledger/patches/patch-src_report.cc Thu May 2 13:27:04 2024 @@ -0,0 +1,20 @@ +$NetBSD: patch-src_report.cc,v 1.1 2024/05/02 13:27:04 riastradh Exp $ + +Fix ctype abuse. +https://github.com/ledger/ledger/pull/2341 + +--- src/report.cc.orig 2023-03-30 07:40:48.000000000 +0000 ++++ src/report.cc +@@ -642,10 +642,10 @@ value_t report_t::fn_trim(call_scope_t& + const char * p = buf.get(); + const char * e = buf.get() + temp.length() - 1; + +- while (p <= e && std::isspace(*p)) ++ while (p <= e && std::isspace(static_cast(*p))) + p++; + +- while (e > p && std::isspace(*e)) ++ while (e > p && std::isspace(static_cast(*e))) + e--; + + if (p > e) { Index: pkgsrc/finance/ledger/patches/patch-src_strptime.cc diff -u /dev/null pkgsrc/finance/ledger/patches/patch-src_strptime.cc:1.1 --- /dev/null Thu May 2 13:27:05 2024 +++ pkgsrc/finance/ledger/patches/patch-src_strptime.cc Thu May 2 13:27:04 2024 @@ -0,0 +1,27 @@ +$NetBSD: patch-src_strptime.cc,v 1.1 2024/05/02 13:27:04 riastradh Exp $ + +Fix ctype abuse. +https://github.com/ledger/ledger/pull/2341 + +--- src/strptime.cc.orig 2023-03-30 07:40:48.000000000 +0000 ++++ src/strptime.cc +@@ -62,7 +62,9 @@ static const char* kMonthAbbr[] = { + + static const char* _parse_num(const char* s, int low, int high, int* value) { + const char* p = s; +- for (*value = 0; *p != NULL && isdigit(*p); ++p) { ++ for (*value = 0; ++ *p != NULL && isdigit(static_cast(*p)); ++ ++p) { + *value = (*value) * 10 + static_cast(*p) - static_cast('0'); + } + +@@ -177,7 +179,7 @@ static char* _strptime(const char *s, co + // arbitrary whitespace. + case 't': + case 'n': +- while (isspace(*s)) ++s; ++ while (isspace(static_cast(*s))) ++s; + break; + + // '%'. Index: pkgsrc/finance/ledger/patches/patch-src_textual.cc diff -u /dev/null pkgsrc/finance/ledger/patches/patch-src_textual.cc:1.1 --- /dev/null Thu May 2 13:27:05 2024 +++ pkgsrc/finance/ledger/patches/patch-src_textual.cc Thu May 2 13:27:04 2024 @@ -0,0 +1,110 @@ +$NetBSD: patch-src_textual.cc,v 1.1 2024/05/02 13:27:04 riastradh Exp $ + +Fix ctype abuse. +https://github.com/ledger/ledger/pull/2341 + +--- src/textual.cc.orig 2023-03-30 07:40:48.000000000 +0000 ++++ src/textual.cc +@@ -340,7 +340,8 @@ std::streamsize instance_t::read_line(ch + --len; + } + +- while (len > 0 && std::isspace(line[len - 1])) // strip trailing whitespace ++ // strip trailing whitespace ++ while (len > 0 && std::isspace(static_cast(line[len - 1]))) + line[--len] = '\0'; + + return len; +@@ -355,7 +356,7 @@ void instance_t::read_next_directive(boo + if (len == 0 || line == NULL) + return; + +- if (! std::isspace(line[0])) ++ if (! std::isspace(static_cast(line[0]))) + error_flag = false; + + switch (line[0]) { +@@ -615,12 +616,16 @@ void instance_t::automated_xact_directiv + item->pos->end_line++; + } + else if ((remlen > 7 && *p == 'a' && +- std::strncmp(p, "assert", 6) == 0 && std::isspace(p[6])) || ++ std::strncmp(p, "assert", 6) == 0 && ++ std::isspace(static_cast(p[6]))) || + (remlen > 6 && *p == 'c' && +- std::strncmp(p, "check", 5) == 0 && std::isspace(p[5])) || ++ std::strncmp(p, "check", 5) == 0 && ++ std::isspace(static_cast(p[5]))) || + (remlen > 5 && *p == 'e' && +- ((std::strncmp(p, "expr", 4) == 0 && std::isspace(p[4])) || +- (std::strncmp(p, "eval", 4) == 0 && std::isspace(p[4]))))) { ++ ((std::strncmp(p, "expr", 4) == 0 && ++ std::isspace(static_cast(p[4]))) || ++ (std::strncmp(p, "eval", 4) == 0 && ++ std::isspace(static_cast(p[4])))))) { + const char c = *p; + p = skip_ws(&p[*p == 'a' ? 6 : (*p == 'c' ? 5 : 4)]); + if (! ae->check_exprs) +@@ -1015,7 +1020,7 @@ void instance_t::alias_directive(char * + { + if (char * e = std::strchr(line, '=')) { + char * z = e - 1; +- while (std::isspace(*z)) ++ while (std::isspace(static_cast(*z))) + *z-- = '\0'; + *e++ = '\0'; + e = skip_ws(e); +@@ -1234,7 +1239,7 @@ void instance_t::python_directive(char * + if (read_line(line) > 0) { + if (! indent) { + const char * p = line; +- while (*p && std::isspace(*p)) { ++ while (*p && std::isspace(static_cast(*p))) { + ++indent; + ++p; + } +@@ -1242,7 +1247,7 @@ void instance_t::python_directive(char * + + const char * p = line; + for (std::size_t i = 0; i < indent; i++) { +- if (std::isspace(*p)) ++ if (std::isspace(static_cast(*p))) + ++p; + else + break; +@@ -1473,7 +1478,7 @@ post_t * instance_t::parse_post(char * + char * next = next_element(p, true); + char * e = p + std::strlen(p); + +- while (e > p && std::isspace(*(e - 1))) ++ while (e > p && std::isspace(static_cast(*(e - 1)))) + e--; + + if ((*p == '[' && *(e - 1) == ']') || (*p == '(' && *(e - 1) == ')')) { +@@ -1884,7 +1889,7 @@ xact_t * instance_t::parse_xact(char * + } + else if (*p == ';' && (tabs > 0 || spaces > 1)) { + char *q = p - 1; +- while (q > next && std::isspace(*q)) ++ while (q > next && std::isspace(static_cast(*q))) + --q; + if (q >= next) + *(q + 1) = '\0'; +@@ -1937,11 +1942,14 @@ xact_t * instance_t::parse_xact(char * + item->pos->end_line++; + } + else if ((remlen > 7 && *p == 'a' && +- std::strncmp(p, "assert", 6) == 0 && std::isspace(p[6])) || ++ std::strncmp(p, "assert", 6) == 0 && ++ std::isspace(static_cast(p[6]))) || + (remlen > 6 && *p == 'c' && +- std::strncmp(p, "check", 5) == 0 && std::isspace(p[5])) || ++ std::strncmp(p, "check", 5) == 0 && ++ std::isspace(static_cast(p[5]))) || + (remlen > 5 && *p == 'e' && +- std::strncmp(p, "expr", 4) == 0 && std::isspace(p[4]))) { ++ std::strncmp(p, "expr", 4) == 0 && ++ std::isspace(static_cast(p[4])))) { + const char c = *p; + p = skip_ws(&p[*p == 'a' ? 6 : (*p == 'c' ? 5 : 4)]); + expr_t expr(p); Index: pkgsrc/finance/ledger/patches/patch-src_times.cc diff -u /dev/null pkgsrc/finance/ledger/patches/patch-src_times.cc:1.1 --- /dev/null Thu May 2 13:27:05 2024 +++ pkgsrc/finance/ledger/patches/patch-src_times.cc Thu May 2 13:27:04 2024 @@ -0,0 +1,57 @@ +$NetBSD: patch-src_times.cc,v 1.1 2024/05/02 13:27:04 riastradh Exp $ + +Fix ctype abuse. +https://github.com/ledger/ledger/pull/2341 + +--- src/times.cc.orig 2023-03-30 07:40:48.000000000 +0000 ++++ src/times.cc +@@ -1467,7 +1467,7 @@ date_parser_t::lexer_t::token_t date_par + return tok; + } + +- while (begin != end && std::isspace(*begin)) ++ while (begin != end && std::isspace(static_cast(*begin))) + begin++; + + if (begin == end) +@@ -1486,9 +1486,11 @@ date_parser_t::lexer_t::token_t date_par + // date using the typical date formats. This allows not only dates like + // "2009/08/01", but also dates that fit the user's --input-date-format, + // assuming their format fits in one argument and begins with a digit. +- if (std::isdigit(*begin)) { ++ if (std::isdigit(static_cast(*begin))) { + string::const_iterator i = begin; +- for (i = begin; i != end && ! std::isspace(*i); i++) {} ++ for (i = begin; ++ i != end && ! std::isspace(static_cast(*i)); ++ i++) {} + assert(i != begin); + + string possible_date(start, i); +@@ -1513,18 +1515,20 @@ date_parser_t::lexer_t::token_t date_par + start = begin; + + string term; +- bool alnum = std::isalnum(*begin); +- for (; (begin != end && ! std::isspace(*begin) && +- ((alnum && static_cast(std::isalnum(*begin))) || +- (! alnum && ! static_cast(std::isalnum(*begin))))); begin++) ++ bool alnum = std::isalnum(static_cast(*begin)); ++ for (; (begin != end && ! std::isspace(static_cast(*begin)) && ++ ((alnum && static_cast(std::isalnum( ++ static_cast(*begin)))) || ++ (! alnum && ! static_cast(std::isalnum( ++ static_cast(*begin)))))); begin++) + term.push_back(*begin); + + if (! term.empty()) { +- if (std::isdigit(term[0])) { ++ if (std::isdigit(static_cast(term[0]))) { + return token_t(token_t::TOK_INT, + token_t::content_t(lexical_cast(term))); + } +- else if (std::isalpha(term[0])) { ++ else if (std::isalpha(static_cast(term[0]))) { + to_lower(term); + + if (optional month = Index: pkgsrc/finance/ledger/patches/patch-src_utils.cc diff -u /dev/null pkgsrc/finance/ledger/patches/patch-src_utils.cc:1.1 --- /dev/null Thu May 2 13:27:05 2024 +++ pkgsrc/finance/ledger/patches/patch-src_utils.cc Thu May 2 13:27:04 2024 @@ -0,0 +1,16 @@ +$NetBSD: patch-src_utils.cc,v 1.1 2024/05/02 13:27:04 riastradh Exp $ + +Fix ctype abuse. +https://github.com/ledger/ledger/pull/2341 + +--- src/utils.cc.orig 2023-03-30 07:40:48.000000000 +0000 ++++ src/utils.cc +@@ -516,7 +516,7 @@ strings_list split_arguments(const char + char in_quoted_string = '\0'; + + for (const char * p = line; *p; p++) { +- if (! in_quoted_string && std::isspace(*p)) { ++ if (! in_quoted_string && std::isspace(static_cast(*p))) { + if (q != buf) { + *q = '\0'; + args.push_back(buf); Index: pkgsrc/finance/ledger/patches/patch-src_xact.cc diff -u /dev/null pkgsrc/finance/ledger/patches/patch-src_xact.cc:1.1 --- /dev/null Thu May 2 13:27:05 2024 +++ pkgsrc/finance/ledger/patches/patch-src_xact.cc Thu May 2 13:27:04 2024 @@ -0,0 +1,20 @@ +$NetBSD: patch-src_xact.cc,v 1.1 2024/05/02 13:27:04 riastradh Exp $ + +Fix ctype abuse. +https://github.com/ledger/ledger/pull/2341 + +--- src/xact.cc.orig 2023-03-30 07:40:48.000000000 +0000 ++++ src/xact.cc +@@ -116,8 +116,10 @@ value_t xact_base_t::magnitude() const + namespace { + inline bool account_ends_with_special_char(const string& name) { + string::size_type len(name.length()); +- return (std::isdigit(name[len - 1]) || name[len - 1] == ')' || +- name[len - 1] == '}' || name[len - 1] == ']'); ++ return (std::isdigit(static_cast(name[len - 1])) || ++ name[len - 1] == ')' || ++ name[len - 1] == '}' || ++ name[len - 1] == ']'); + } + + struct add_balancing_post --_----------=_1714656425222480--