Switched to a case insensitive search method.
This commit is contained in:
		
							parent
							
								
									0094d2755b
								
							
						
					
					
						commit
						667b9d5d53
					
				@ -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
 | 
					 * 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
 | 
					 * keys, and arbitrary data for each key. It works similar to a hash, and
 | 
				
			||||||
@ -29,6 +29,7 @@
 | 
				
			|||||||
#  include 	<sys/types.h>
 | 
					#  include 	<sys/types.h>
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include        <ctype.h>
 | 
				
			||||||
#include 	<stdio.h>
 | 
					#include 	<stdio.h>
 | 
				
			||||||
#include 	<stdlib.h>
 | 
					#include 	<stdlib.h>
 | 
				
			||||||
#include	<string.h>
 | 
					#include	<string.h>
 | 
				
			||||||
@ -386,9 +387,9 @@ int ternary_search(TERNARY tno, const char *s, void **data)
 | 
				
			|||||||
	p = trees[cur]->tree_root;
 | 
						p = trees[cur]->tree_root;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	while (p) {
 | 
						while (p) {
 | 
				
			||||||
		if (*s < p->splitchar)
 | 
							if (toupper(*s) < toupper(p->splitchar))
 | 
				
			||||||
			p = p->lokid;
 | 
								p = p->lokid;
 | 
				
			||||||
		else if (*s == p->splitchar) {
 | 
							else if (toupper(*s) == toupper(p->splitchar)) {
 | 
				
			||||||
			if (*s++ == 0) {
 | 
								if (*s++ == 0) {
 | 
				
			||||||
				if (data)
 | 
									if (data)
 | 
				
			||||||
					*data = (void *)p->eqkid;
 | 
										*data = (void *)p->eqkid;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user