diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2007-03-18 20:13:50 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2007-03-18 20:13:50 +0000 |
commit | ac1137b6a847c7588490a81e52944d5a73b778ac (patch) | |
tree | 2f5f0621fb41393935b8c4d628598c9c259dc6c9 /usr.bin/locate/bigram | |
parent | a3396f1e62f80fcd096c538c5a3ce406d196b6c0 (diff) |
It's not smart to use a space as a field separator when a space can
be part of a bigram. So switch to tab and as a bonus detect in
locate.code if the bigram array is too short. Problem seen by Han
Boetes and other people with too big mps3 collections; these typically
contain lots of file names with spaces in them. ok jasper@
Diffstat (limited to 'usr.bin/locate/bigram')
-rw-r--r-- | usr.bin/locate/bigram/locate.bigram.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/locate/bigram/locate.bigram.c b/usr.bin/locate/bigram/locate.bigram.c index b741b29ccb3..8d5a62696fc 100644 --- a/usr.bin/locate/bigram/locate.bigram.c +++ b/usr.bin/locate/bigram/locate.bigram.c @@ -1,5 +1,5 @@ /* - * $OpenBSD: locate.bigram.c,v 1.10 2003/09/29 16:03:16 deraadt Exp $ + * $OpenBSD: locate.bigram.c,v 1.11 2007/03/18 20:13:49 otto Exp $ * * Copyright (c) 1995 Wolfram Schneider <wosch@FreeBSD.org>. Berlin. * Copyright (c) 1989, 1993 @@ -32,7 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: locate.bigram.c,v 1.10 2003/09/29 16:03:16 deraadt Exp $ + * $Id: locate.bigram.c,v 1.11 2007/03/18 20:13:49 otto Exp $ */ #ifndef lint @@ -41,7 +41,7 @@ static char copyright[] = "@(#) Copyright (c) 1989, 1993\n\ The Regents of the University of California. All rights reserved.\n"; #else -static char rcsid[] = "$OpenBSD: locate.bigram.c,v 1.10 2003/09/29 16:03:16 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: locate.bigram.c,v 1.11 2007/03/18 20:13:49 otto Exp $"; #endif #endif /* not lint */ @@ -106,7 +106,7 @@ main(void) for (i = ASCII_MIN; i <= ASCII_MAX; i++) for (j = ASCII_MIN; j <= ASCII_MAX; j++) if (bigram[i][j] != 0) - (void)printf("%4u %c%c\n", bigram[i][j], i, j); + (void)printf("%4u\t%c%c\n", bigram[i][j], i, j); exit(0); } |