From 987507131d72dcdd8008f18e301dd8bc3551a572 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Tue, 19 Sep 2023 22:08:24 +0900 Subject: Update hashing code for strings to be the same as upstream gettext. The old version results in slightly different hash values for strings with ellipsis (and potentially other unicode characters). This relates to TDE/tdebase#394. Signed-off-by: Michele Calgaro --- tdecore/libintl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tdecore') diff --git a/tdecore/libintl.cpp b/tdecore/libintl.cpp index 5d2f6a086..c7b8c7ee6 100644 --- a/tdecore/libintl.cpp +++ b/tdecore/libintl.cpp @@ -260,8 +260,8 @@ hash_string (const char *str_param) while (*str != '\0') { hval <<= 4; - hval += (unsigned long) *str++; - g = hval & ((unsigned long) 0xf << (HASHWORDBITS - 4)); + hval += (unsigned char) *str++; + g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4)); if (g != 0) { hval ^= g >> (HASHWORDBITS - 8); -- cgit v1.2.3