diff options
author | Robert James Kaes <rjkaes@users.sourceforge.net> | 2001-09-04 17:53:41 +0000 |
---|---|---|
committer | Robert James Kaes <rjkaes@users.sourceforge.net> | 2001-09-04 17:53:41 +0000 |
commit | 667b9d5d5316c05955adf96132117cd276b58020 (patch) | |
tree | 504b401eb73922c09e742e4c36515a20e7245bd0 | |
parent | 0094d2755b95e2278fa954d8defe9332d0ae2d65 (diff) | |
download | tinyproxy-667b9d5d5316c05955adf96132117cd276b58020.tar.gz tinyproxy-667b9d5d5316c05955adf96132117cd276b58020.zip |
Switched to a case insensitive search method.
-rw-r--r-- | src/ternary.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ternary.c b/src/ternary.c index 0a4ee09..2917149 100644 --- a/src/ternary.c +++ b/src/ternary.c @@ -1,4 +1,4 @@ -/* $Id: ternary.c,v 1.6 2001-08-30 16:52:09 rjkaes Exp $ +/* $Id: ternary.c,v 1.7 2001-09-04 17:53:41 rjkaes Exp $ * * This module creates a Ternary Search Tree which can store both string * keys, and arbitrary data for each key. It works similar to a hash, and @@ -29,6 +29,7 @@ # include <sys/types.h> #endif +#include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -386,9 +387,9 @@ int ternary_search(TERNARY tno, const char *s, void **data) p = trees[cur]->tree_root; while (p) { - if (*s < p->splitchar) + if (toupper(*s) < toupper(p->splitchar)) p = p->lokid; - else if (*s == p->splitchar) { + else if (toupper(*s) == toupper(p->splitchar)) { if (*s++ == 0) { if (data) *data = (void *)p->eqkid; |