Commit 95f5ac13 authored by Pekka Pessi's avatar Pekka Pessi

msg_parser.awk: removed gawkism from header name hash calculation

darcs-hash:20070307103222-88462-8760a9aa67804a7a35667b694641bb47e857199d.gz
parent c8782058
......@@ -80,13 +80,18 @@ function name_hash (name)
{
hash = 0;
len = split(name, chars, "");
len = length(name);
for (i = 1; i <= len; i++) {
c = tolower(chars[i]);
c = tolower(substr(name, i, 1));
hash = (38501 * (hash + index(ascii, c))) % 65536;
}
if (hash == 0) {
print "*** msg_parser.awk: calculating hash failed\n";
exit(5);
}
if (0) {
# Test that hash algorithm above agrees with the C version
pipe = ("../msg/msg_name_hash " name);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment