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 <michele.calgaro@yahoo.it>
(cherry picked from commit 987507131d)
pull/232/head
Michele Calgaro 8 months ago
parent 615cb38ff9
commit d254bec7e7
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -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);

Loading…
Cancel
Save