aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/man_hash.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-08-19 09:14:50 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-08-19 09:14:50 +0000
commit02379e543c459cb8556393d0ab5fda334edab0d7 (patch)
treee2c0ae80fd57b42975341ea1741bd86884b3cafc /man_hash.c
parent7c67b43d407196d43169cf857b1412fca26b1ad5 (diff)
downloadmandoc-02379e543c459cb8556393d0ab5fda334edab0d7.tar.gz
mandoc-02379e543c459cb8556393d0ab5fda334edab0d7.tar.zst
mandoc-02379e543c459cb8556393d0ab5fda334edab0d7.zip
Added RS/RE macro pair (had to adjust closing rules, sec/ssec/rs/par).
Diffstat (limited to 'man_hash.c')
-rw-r--r--man_hash.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/man_hash.c b/man_hash.c
index 11913891..9b65bc30 100644
--- a/man_hash.c
+++ b/man_hash.c
@@ -1,4 +1,4 @@
-/* $Id: man_hash.c,v 1.10 2009/06/18 10:32:00 kristaps Exp $ */
+/* $Id: man_hash.c,v 1.11 2009/08/19 09:14:50 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -39,10 +39,10 @@ man_hash_alloc(void)
/* Initialised to -1. */
- htab = malloc(26 * 5 * sizeof(int));
+ htab = malloc(26 * 6 * sizeof(int));
if (NULL == htab)
return(NULL);
- for (i = 0; i < 26 * 5; i++)
+ for (i = 0; i < 26 * 6; i++)
htab[i] = -1;
for (i = 0; i < MAN_MAX; i++) {
@@ -52,15 +52,15 @@ man_hash_alloc(void)
(x >= 97 && x <= 122));
x -= (x <= 90) ? 65 : 97;
- x *= 5;
+ x *= 6;
- for (j = 0; j < 5; j++)
+ for (j = 0; j < 6; j++)
if (-1 == htab[x + j]) {
htab[x + j] = i;
break;
}
- assert(j < 5);
+ assert(j < 6);
}
return((void *)htab);
@@ -81,9 +81,9 @@ man_hash_find(const void *arg, const char *tmp)
return(MAN_MAX);
x -= (x <= 90) ? 65 : 97;
- x *= 5;
+ x *= 6;
- for (i = 0; i < 5; i++) {
+ for (i = 0; i < 6; i++) {
if (-1 == (tok = htab[x + i]))
return(MAN_MAX);
if (0 == strcmp(tmp, man_macronames[tok]))