diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-03-10 10:20:03 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-03-10 10:20:03 +0000 |
commit | a56da0e3c95a55df0871b52e838862c87c83b886 (patch) | |
tree | 69603d5ae481701c33c3274ce96ee877313a46d5 /hash.c | |
parent | 8022634cf3496fdf405b323b7c0cb938f428fcb2 (diff) | |
download | mandoc-a56da0e3c95a55df0871b52e838862c87c83b886.tar.gz |
Fixed hash lookup regression.
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -130,10 +130,13 @@ mdoc_tokhash_find(const void *arg, const char *tmp) assert(0 == (size_t)slot % sizeof(struct mdoc_macro)); slot /= sizeof(struct mdoc_macro); - if (0 == tmp[2]) - return(slot); + if (mdoc_macronames[slot][0] != tmp[0]) + return(MDOC_MAX); + if (mdoc_macronames[slot][1] != tmp[1]) + return(MDOC_MAX); + if (tmp[2] && mdoc_macronames[slot][2] != tmp[2]) + return(MDOC_MAX); - assert(0 == tmp[3]); - return(tmp[2] == mdoc_macronames[slot][2] ? slot : MDOC_MAX); + return(slot); } |