diff options
author | wosch <wosch@FreeBSD.org> | 1996-10-13 01:44:43 +0000 |
---|---|---|
committer | wosch <wosch@FreeBSD.org> | 1996-10-13 01:44:43 +0000 |
commit | 1edf24275a071892cdbff4ba07879dea75987a51 (patch) | |
tree | ba20d97a5160d5236052b18ca5c02a3b4d24bd94 /usr.bin/locate/bigram/locate.bigram.c | |
parent | 154b44fb0a407fda8021c14d48dc08625f97bdbc (diff) | |
download | FreeBSD-src-1edf24275a071892cdbff4ba07879dea75987a51.zip FreeBSD-src-1edf24275a071892cdbff4ba07879dea75987a51.tar.gz |
8-Bit character support.
Old locate(1) programs still works with the new database format, print
some garbage for 8 bit characters, but don't core (maybe except char 30).
7-Bit Puritan should not notice any difference. Same speed,
Same database size if the database contain only ASCII characters.
Reviewed by: ache
Diffstat (limited to 'usr.bin/locate/bigram/locate.bigram.c')
-rw-r--r-- | usr.bin/locate/bigram/locate.bigram.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/locate/bigram/locate.bigram.c b/usr.bin/locate/bigram/locate.bigram.c index e7d86a4..2196957 100644 --- a/usr.bin/locate/bigram/locate.bigram.c +++ b/usr.bin/locate/bigram/locate.bigram.c @@ -1,4 +1,5 @@ /* + * Copyright (c) 1995 Wolfram Schneider <wosch@FreeBSD.org>. Berlin. * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * @@ -33,7 +34,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: locate.bigram.c,v 1.1 1996/09/13 13:23:48 wosch Exp wosch $ + * $Id: locate.bigram.c,v 1.7 1996/09/14 20:15:49 wosch Exp $ */ #ifndef lint @@ -60,7 +61,7 @@ static char sccsid[] = "@(#)locate.bigram.c 8.1 (Berkeley) 6/6/93"; u_char buf1[MAXPATHLEN] = " "; u_char buf2[MAXPATHLEN]; -u_int bigram[UCHAR_MAX][UCHAR_MAX]; +u_int bigram[UCHAR_MAX + 1][UCHAR_MAX + 1]; int main(void) @@ -84,7 +85,7 @@ main(void) break; while (*cp != '\0' && *(cp + 1) != '\0') { - bigram[(u_int)*cp][(u_int)*(cp + 1)]++; + bigram[(u_char)*cp][(u_char)*(cp + 1)]++; cp += 2; } |