head 1.1; access; symbols; locks; strict; comment @// @; 1.1 date 2026.08.11.14.21.47; author riastradh; state Exp; branches; next ; commitid pftVZIdqGCIraeRG; desc @@ 1.1 log @net/transmission: Fix ctype abuse. Excluding the third-party/ directory for now -- lot more patching to do for that. PR pkg/60574: transmission-daemon etc. abort on invalid toupper(3) call @ text @$NetBSD$ --- libtransmission/file-win32.cc.orig 2026-06-29 23:12:56.000000000 +0000 +++ libtransmission/file-win32.cc @@@@ -118,14 +118,14 @@@@ bool is_valid_path(std::string_view path { if (is_unc_path(path)) { - if (path[2] != '\0' && isalnum(path[2]) == 0) + if (path[2] != '\0' && isalnum(static_cast(path[2])) == 0) { return false; } } else if (auto const pos = path.find(':'); pos != std::string_view::npos) { - if (pos != 1 || isalpha(path[0]) == 0) + if (pos != 1 || isalpha(static_cast(path[0])) == 0) { return false; } @@@@ -448,13 +448,13 @@@@ bool tr_sys_path_is_relative(std::string } /* Local path: `X:` */ - if (std::size(path) == 2 && isalpha(path[0]) != 0 && path[1] == ':') + if (std::size(path) == 2 && isalpha(static_cast(path[0])) != 0 && path[1] == ':') { return false; } /* Local path: `X:\...`. */ - if (std::size(path) > 2 && isalpha(path[0]) != 0 && path[1] == ':' && is_slash(path[2])) + if (std::size(path) > 2 && isalpha(static_cast(path[0])) != 0 && path[1] == ':' && is_slash(path[2])) { return false; } @@@@ -561,7 +561,7 @@@@ namespace { [[nodiscard]] bool isWindowsDeviceRoot(char ch) noexcept { - return isalpha(static_cast(ch)) != 0; + return isalpha(static_cast(ch)) != 0; } [[nodiscard]] constexpr bool isPathSeparator(char ch) noexcept @