summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/locate/bigram/locate.bigram.c46
-rw-r--r--usr.bin/locate/code/locate.code.c89
-rw-r--r--usr.bin/locate/locate/fastfind.c98
-rw-r--r--usr.bin/locate/locate/locate.110
-rw-r--r--usr.bin/locate/locate/locate.c31
-rw-r--r--usr.bin/locate/locate/locate.h3
-rw-r--r--usr.bin/locate/locate/updatedb.sh5
7 files changed, 178 insertions, 104 deletions
diff --git a/usr.bin/locate/bigram/locate.bigram.c b/usr.bin/locate/bigram/locate.bigram.c
index ad2f7ae0216..92b0a6ccafb 100644
--- a/usr.bin/locate/bigram/locate.bigram.c
+++ b/usr.bin/locate/bigram/locate.bigram.c
@@ -1,6 +1,7 @@
-/* $OpenBSD: locate.bigram.c,v 1.5 1996/09/15 16:50:35 michaels Exp $ */
-
/*
+ * $OpenBSD: locate.bigram.c,v 1.6 1996/10/20 00:52:51 michaels Exp $
+ *
+ * Copyright (c) 1995 Wolfram Schneider <wosch@FreeBSD.org>. Berlin.
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -35,21 +36,21 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: locate.bigram.c,v 1.5 1996/09/15 16:50:35 michaels Exp $
+ * $Id: locate.bigram.c,v 1.6 1996/10/20 00:52:51 michaels Exp $
*/
#ifndef lint
+#if 0
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.6 1996/10/20 00:52:51 michaels Exp $";
+#endif
#endif /* not lint */
#ifndef lint
-#if 0
static char sccsid[] = "@(#)locate.bigram.c 8.1 (Berkeley) 6/6/93";
-#else
-static char rcsid[] = "$OpenBSD: locate.bigram.c,v 1.5 1996/09/15 16:50:35 michaels Exp $";
-#endif
#endif /* not lint */
/*
@@ -66,7 +67,7 @@ static char rcsid[] = "$OpenBSD: locate.bigram.c,v 1.5 1996/09/15 16:50:35 micha
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)
@@ -77,25 +78,20 @@ main(void)
while (fgets(path, sizeof(buf2), stdin) != NULL) {
- /* skip empty lines */
- if (*path == '\n')
- continue;
+ /*
+ * We don't need remove newline character '\n'.
+ * '\n' is less than ASCII_MIN and will be later
+ * ignored at output.
+ */
- /* Squelch characters that would botch the decoding. */
- for (cp = path; *cp != '\0'; cp++) {
- /* chop newline */
- if (*cp == '\n')
- *cp = '\0';
- /* range */
- else if (*cp < ASCII_MIN || *cp > ASCII_MAX)
- *cp = '?';
- }
/* skip longest common prefix */
- for (cp = path; *cp == *oldpath && *cp != '\0'; cp++, oldpath++);
+ for (cp = path; *cp == *oldpath; cp++, oldpath++)
+ if (*cp == '\0')
+ break;
- while (*cp != '\0' && *(cp+1) != '\0') {
- bigram[*cp][*(cp+1)]++;
+ while (*cp != '\0' && *(cp + 1) != '\0') {
+ bigram[(u_char)*cp][(u_char)*(cp + 1)]++;
cp += 2;
}
@@ -109,11 +105,11 @@ main(void)
}
}
- /* output, (paranoid) boundary check */
+ /* output, boundary check */
for (i = ASCII_MIN; i <= ASCII_MAX; i++)
for (j = ASCII_MIN; j <= ASCII_MAX; j++)
if (bigram[i][j] != 0)
- printf("%4u %c%c\n", bigram[i][j], i, j);
+ (void)printf("%4u %c%c\n", bigram[i][j], i, j);
exit(0);
}
diff --git a/usr.bin/locate/code/locate.code.c b/usr.bin/locate/code/locate.code.c
index 9daa9f5a0d0..b95718ed4be 100644
--- a/usr.bin/locate/code/locate.code.c
+++ b/usr.bin/locate/code/locate.code.c
@@ -1,6 +1,6 @@
-/* $OpenBSD: locate.code.c,v 1.5 1996/09/15 16:50:36 michaels Exp $ */
-
/*
+ * $OpenBSD: locate.code.c,v 1.6 1996/10/20 00:52:53 michaels Exp $
+ *
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -35,7 +35,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: locate.code.c,v 1.5 1996/09/15 16:50:36 michaels Exp $
+ * $Id: locate.code.c,v 1.6 1996/10/20 00:52:53 michaels Exp $
*/
#ifndef lint
@@ -48,7 +48,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)locate.code.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: locate.code.c,v 1.5 1996/09/15 16:50:36 michaels Exp $";
+static char rcsid[] = "$OpenBSD: locate.code.c,v 1.6 1996/10/20 00:52:53 michaels Exp $";
#endif
#endif /* not lint */
@@ -78,13 +78,22 @@ static char rcsid[] = "$OpenBSD: locate.code.c,v 1.5 1996/09/15 16:50:36 michael
*
* 0-28 likeliest differential counts + offset to make nonnegative
* 30 switch code for out-of-range count to follow in next word
+ * 31 an 8 bit char followed
* 128-255 bigram codes (128 most common, as determined by 'updatedb')
* 32-127 single character (printable) ascii residue (ie, literal)
*
- * SEE ALSO: updatedb.csh, bigram.c
+ * The locate database store any character except newline ('\n')
+ * and NUL ('\0'). The 8-bit character support don't wast extra
+ * space until you have characters in file names less than 32
+ * or greather than 127.
+ *
+ *
+ * SEE ALSO: updatedb.sh, ../bigram/locate.bigram.c
*
* AUTHOR: James A. Woods, Informatics General Corp.,
* NASA Ames Research Center, 10/82
+ * 8-bit file names characters:
+ * Wolfram Schneider, Berlin September 1996
*/
#include <sys/param.h>
@@ -99,14 +108,14 @@ static char rcsid[] = "$OpenBSD: locate.code.c,v 1.5 1996/09/15 16:50:36 michael
u_char buf1[MAXPATHLEN] = " ";
u_char buf2[MAXPATHLEN];
-char bigrams[BGBUFSIZE + 1] = { 0 };
+u_char bigrams[BGBUFSIZE + 1] = { 0 };
#define LOOKUP 1 /* use a lookup array instead a function, 3x faster */
#ifdef LOOKUP
-#define BGINDEX(x) (big[(u_int)*x][(u_int)*(x+1)])
-typedef u_char bg_t;
-bg_t big[UCHAR_MAX][UCHAR_MAX];
+#define BGINDEX(x) (big[(u_char)*x][(u_char)*(x + 1)])
+typedef short bg_t;
+bg_t big[UCHAR_MAX + 1][UCHAR_MAX + 1];
#else
#define BGINDEX(x) bgindex(x)
typedef int bg_t;
@@ -151,12 +160,13 @@ main(argc, argv)
#ifdef LOOKUP
/* init lookup table */
- for (i = 0; i < UCHAR_MAX; i++)
- for (j = 0; j < UCHAR_MAX; j++)
+ for (i = 0; i < UCHAR_MAX + 1; i++)
+ for (j = 0; j < UCHAR_MAX + 1; j++)
big[i][j] = (bg_t)-1;
for (cp = bigrams, i = 0; *cp != '\0'; i += 2, cp += 2)
- big[(int)*cp][(int)*(cp + 1)] = (bg_t)i;
+ big[(u_char)*cp][(u_char)*(cp + 1)] = (bg_t)i;
+
#endif /* LOOKUP */
oldpath = buf1;
@@ -165,22 +175,21 @@ main(argc, argv)
while (fgets(path, sizeof(buf2), stdin) != NULL) {
- /* skip empty lines */
+ /* skip empty lines */
if (*path == '\n')
continue;
- /* Squelch characters that would botch the decoding. */
+ /* remove newline */
for (cp = path; *cp != '\0'; cp++) {
/* chop newline */
if (*cp == '\n')
*cp = '\0';
- /* range */
- else if (*cp < ASCII_MIN || *cp > ASCII_MAX)
- *cp = '?';
}
/* Skip longest common prefix. */
- for (cp = path; *cp == *oldpath && *cp != '\0'; cp++, oldpath++);
+ for (cp = path; *cp == *oldpath; cp++, oldpath++)
+ if (*cp == '\0')
+ break;
count = cp - path;
diffcount = count - oldcount + OFFSET;
@@ -194,22 +203,42 @@ main(argc, argv)
err(1, "stdout");
while (*cp != '\0') {
- if (*(cp + 1) == '\0') {
- if (putchar(*cp) == EOF)
- err(1, "stdout");
- break;
- }
- if ((code = BGINDEX(cp)) == (bg_t)-1) {
- if (putchar(*cp++) == EOF ||
- putchar(*cp++) == EOF)
- err(1, "stdout");
- } else {
- /* Found, so mark byte with parity bit. */
+ /* print *two* characters */
+
+ if ((code = BGINDEX(cp)) != (bg_t)-1) {
+ /*
+ * print *one* as bigram
+ * Found, so mark byte with
+ * parity bit.
+ */
if (putchar((code / 2) | PARITY) == EOF)
err(1, "stdout");
cp += 2;
}
+
+ else {
+ for (i = 0; i < 2; i++) {
+ if (*cp == '\0')
+ break;
+
+ /* print umlauts in file names */
+ if (*cp < ASCII_MIN ||
+ *cp > ASCII_MAX) {
+ if (putchar(UMLAUT) == EOF ||
+ putchar(*cp++) == EOF)
+ err(1, "stdout");
+ }
+
+ else {
+ /* normal character */
+ if(putchar(*cp++) == EOF)
+ err(1, "stdout");
+ }
+ }
+
+ }
}
+
if (path == buf1) { /* swap pointers */
path = buf2;
oldpath = buf1;
@@ -236,7 +265,7 @@ bgindex(bg) /* Return location of bg in bigrams or -1. */
for (p = bigrams; *p != NULL; p++)
if (*p++ == bg0 && *p == bg1)
break;
- return (*p == NUL ? -1 : (--p - bigrams));
+ return (*p == NULL ? -1 : (--p - bigrams));
}
#endif /* !LOOKUP */
diff --git a/usr.bin/locate/locate/fastfind.c b/usr.bin/locate/locate/fastfind.c
index 9f7b099f0ed..a014f3ab551 100644
--- a/usr.bin/locate/locate/fastfind.c
+++ b/usr.bin/locate/locate/fastfind.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fastfind.c,v 1.2 1996/10/10 09:55:06 michaels Exp $ */
+/* $OpenBSD: fastfind.c,v 1.3 1996/10/20 00:52:54 michaels Exp $ */
/*
* Copyright (c) 1995 Wolfram Schneider <wosch@FreeBSD.org>. Berlin.
@@ -36,7 +36,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: fastfind.c,v 1.2 1996/10/10 09:55:06 michaels Exp $
+ * $Id: fastfind.c,v 1.3 1996/10/20 00:52:54 michaels Exp $
*/
#ifndef _LOCATE_STATISTIC_
@@ -47,10 +47,10 @@ statistic (fp, path_fcodes)
FILE *fp; /* open database */
char *path_fcodes; /* for error message */
{
- register int lines, chars, size, big;
+ register int lines, chars, size, big, zwerg;
register u_char *p, *s;
register int c;
- int count;
+ int count, umlaut;
u_char bigram1[NBG], bigram2[NBG], path[MAXPATHLEN];
for (c = 0, p = bigram1, s = bigram2; c < NBG; c++) {
@@ -58,20 +58,27 @@ statistic (fp, path_fcodes)
s[c] = check_bigram_char(getc(fp));
}
- lines = chars = big = 0;
+ lines = chars = big = zwerg = umlaut = 0;
size = NBG + NBG;
for (c = getc(fp), count = 0; c != EOF; size++) {
if (c == SWITCH) {
count += getwf(fp) - OFFSET;
size += sizeof(int);
+ zwerg++;
} else
count += c - OFFSET;
for (p = path + count; (c = getc(fp)) > SWITCH; size++)
- if (c < PARITY)
+ if (c < PARITY) {
+ if (c == UMLAUT) {
+ c = getc(fp);
+ size++;
+ umlaut++;
+ }
p++;
- else {
+ } else {
+ /* bigram char */
big++;
p += 2;
}
@@ -83,13 +90,16 @@ statistic (fp, path_fcodes)
(void)printf("\nDatabase: %s\n", path_fcodes);
(void)printf("Compression: Front: %2.2f%%, ",
- (float)(100 * (size + big)) / chars);
+ (float)(100 * (size + big - (2 * NBG))) / chars);
(void)printf("Bigram: %2.2f%%, ", (float)(100 * (size - big)) / size);
- (void)printf("Total: %2.2f%%\n", (float)(100 * size) / chars);
+ (void)printf("Total: %2.2f%%\n",
+ (float)(100 * (size - (2 * NBG))) / chars);
(void)printf("Filenames: %d, ", lines);
- (void)printf("Chars: %d\n", chars);
- (void)printf("Database size: %d, ", size);
- (void)printf("Bigram chars: %d\n", big);
+ (void)printf("Characters: %d, ", chars);
+ (void)printf("Database size: %d\n", size);
+ (void)printf("Bigram characters: %d, ", big);
+ (void)printf("Integers: %d, ", zwerg);
+ (void)printf("8-Bit characters: %d\n", umlaut);
}
#endif /* _LOCATE_STATISTIC_ */
@@ -103,7 +113,7 @@ void
fastfind_mmap_icase
#else
fastfind_mmap
-#endif
+#endif /* FF_ICASE */
(pathpart, paddr, len, database)
char *pathpart; /* search string */
caddr_t paddr; /* mmap pointer */
@@ -116,7 +126,7 @@ fastfind_mmap
#ifdef FF_ICASE
fastfind_icase
-#else /* !FF_ICASE */
+#else
fastfind
#endif /* FF_ICASE */
@@ -137,10 +147,10 @@ fastfind
#ifdef FF_ICASE
/* use a lookup table for case insensitive search */
- u_char table[UCHAR_MAX];
+ u_char table[UCHAR_MAX + 1];
tolower_word(pathpart);
-#endif
+#endif /* FF_ICASE*/
/* init bigram table */
#ifdef FF_MMAP
@@ -158,16 +168,18 @@ fastfind
p[c] = check_bigram_char(getc(fp));
s[c] = check_bigram_char(getc(fp));
}
-#endif
+#endif /* FF_MMAP */
/* find optimal (last) char for searching */
for (p = pathpart; *p != '\0'; p++)
if (index(LOCATE_REG, *p) != NULL)
break;
+
if (*p == '\0')
globflag = 0;
else
globflag = 1;
+
p = pathpart;
patend = patprep(p);
cc = *patend;
@@ -176,7 +188,7 @@ fastfind
/* set patend char to true */
table[TOLOWER(*patend)] = 1;
table[toupper(*patend)] = 1;
-#endif
+#endif /* FF_ICASE */
/* main loop */
@@ -184,10 +196,12 @@ fastfind
foundchar = 0;
#ifdef FF_MMAP
- for (c = (u_char)*paddr++; len-- > 0; ) {
+ c = (u_char)*paddr++; len--;
+ for (; len > 0; ) {
#else
- for (c = getc(fp); c != EOF; ) {
-#endif
+ c = getc(fp);
+ for (; c != EOF; ) {
+#endif /* FF_MMAP */
/* go forward or backward */
if (c == SWITCH) { /* big step, an integer */
@@ -196,7 +210,7 @@ fastfind
len -= INTSIZE; paddr += INTSIZE;
#else
count += getwf(fp) - OFFSET;
-#endif
+#endif /* FF_MMAP */
} else { /* slow step, =< 14 chars */
count += c - OFFSET;
}
@@ -204,18 +218,40 @@ fastfind
/* overlay old path */
p = path + count;
foundchar = p - 1;
+
+ for (;;) {
#ifdef FF_MMAP
- for (; (c = (u_char)*paddr++) > SWITCH; len--)
+ c = (u_char)*paddr++;
+ len--;
#else
- for (; (c = getc(fp)) > SWITCH; )
-#endif
-
+ c = getc(fp);
+#endif /* FF_MMAP */
+ /*
+ * == UMLAUT: 8 bit char followed
+ * <= SWITCH: offset
+ * >= PARITY: bigram
+ * rest: single ascii char
+ *
+ * offset < SWITCH < UMLAUT < ascii < PARITY < bigram
+ */
if (c < PARITY) {
+ if (c <= UMLAUT) {
+ if (c == UMLAUT) {
+#ifdef FF_MMAP
+ c = (u_char)*paddr++;
+ len--;
+#else
+ c = getc(fp);
+#endif /* FF_MMAP */
+
+ } else
+ break; /* SWITCH */
+ }
#ifdef FF_ICASE
if (table[c])
#else
if (c == cc)
-#endif
+#endif /* FF_ICASE */
foundchar = p;
*p++ = c;
}
@@ -230,13 +266,13 @@ fastfind
if (table[bigram1[c]] ||
table[bigram2[c]])
-#endif
+#endif /* FF_ICASE */
foundchar = p + 1;
*p++ = bigram1[c];
*p++ = bigram2[c];
}
-
+ }
if (found) { /* previous line matched */
cutoff = path;
@@ -253,14 +289,14 @@ fastfind
if (*s == cc
#ifdef FF_ICASE
|| TOLOWER(*s) == cc
-#endif
+#endif /* FF_ICASE */
) { /* fast first char check */
for (p = patend - 1, q = s - 1; *p != '\0';
p--, q--)
if (*q != *p
#ifdef FF_ICASE
&& TOLOWER(*q) != *p
-#endif
+#endif /* FF_ICASE */
)
break;
if (*p == '\0') { /* fast match success */
diff --git a/usr.bin/locate/locate/locate.1 b/usr.bin/locate/locate/locate.1
index c0614374eb1..bbc81305709 100644
--- a/usr.bin/locate/locate/locate.1
+++ b/usr.bin/locate/locate/locate.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: locate.1,v 1.4 1996/09/15 16:50:38 michaels Exp $
+.\" $OpenBSD: locate.1,v 1.5 1996/10/20 00:52:56 michaels Exp $
.\"
.\" Copyright (c) 1995 Wolfram Schneider <wosch@FreeBSD.org>. Berlin.
.\" Copyright (c) 1990, 1993
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)locate.1 8.1 (Berkeley) 6/6/93
-.\" $Id: locate.1,v 1.4 1996/09/15 16:50:38 michaels Exp $
+.\" $Id: locate.1,v 1.5 1996/10/20 00:52:56 michaels Exp $
.\"
.Dd June 6, 1993
.Dt LOCATE 1
@@ -68,6 +68,12 @@ including slashes (``/'').
As a special case, a pattern containing no globbing characters (``foo'')
is matched as though it were ``*foo*''.
+Historically, locate store only characters between 32 and 127. The
+current implementation store any character except newline ('\\n') and
+NUL ('\\0'). The 8-bit character support don't wast extra space for
+plain ASCII file names. Characters less than 32 or greather than 127
+are stored in 2 bytes.
+
The following options are available:
.Bl -tag -width 10n indent
.It Fl S
diff --git a/usr.bin/locate/locate/locate.c b/usr.bin/locate/locate/locate.c
index 46bd77db20e..7c1810ff455 100644
--- a/usr.bin/locate/locate/locate.c
+++ b/usr.bin/locate/locate/locate.c
@@ -1,6 +1,6 @@
-/* $OpenBSD: locate.c,v 1.5 1996/09/15 16:50:38 michaels Exp $ */
-
/*
+ * $OpenBSD: locate.c,v 1.6 1996/10/20 00:52:56 michaels Exp $
+ *
* Copyright (c) 1995 Wolfram Schneider <wosch@FreeBSD.org>. Berlin.
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@@ -36,7 +36,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: locate.c,v 1.5 1996/09/15 16:50:38 michaels Exp $
+ * $Id: locate.c,v 1.6 1996/10/20 00:52:56 michaels Exp $
*/
#ifndef lint
@@ -50,7 +50,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)locate.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: locate.c,v 1.5 1996/09/15 16:50:38 michaels Exp $";
+static char rcsid[] = "$OpenBSD: locate.c,v 1.6 1996/10/20 00:52:56 michaels Exp $";
#endif
#endif /* not lint */
@@ -66,6 +66,7 @@ static char rcsid[] = "$OpenBSD: locate.c,v 1.5 1996/09/15 16:50:38 michaels Exp
*
* 0-28 likeliest differential counts + offset to make nonnegative
* 30 switch code for out-of-range count to follow in next word
+ * 31 an 8 bit char followed
* 128-255 bigram codes (128 most common, as determined by 'updatedb')
* 32-127 single character (printable) ascii residue (ie, literal)
*
@@ -82,19 +83,22 @@ static char rcsid[] = "$OpenBSD: locate.c,v 1.5 1996/09/15 16:50:38 michaels Exp
*/
#include <sys/param.h>
+#include <ctype.h>
+#include <err.h>
#include <fnmatch.h>
-#include <unistd.h>
+#include <locale.h>
#include <stdio.h>
-#include <string.h>
#include <stdlib.h>
-#include <ctype.h>
+#include <string.h>
+#include <unistd.h>
+
#ifdef MMAP
# include <sys/types.h>
# include <sys/stat.h>
# include <sys/mman.h>
# include <fcntl.h>
#endif
-#include <err.h>
+
#ifdef sun
#include <netinet/in.h> /* SunOS byteorder(3) htohl(3) */
@@ -154,6 +158,7 @@ main(argc, argv)
#ifdef MMAP
f_mmap = 1; /* mmap is default */
#endif
+ (void) setlocale(LC_ALL, "");
while ((ch = getopt(argc, argv, "Scd:il:ms")) != EOF)
switch(ch) {
@@ -204,7 +209,7 @@ main(argc, argv)
}
if (f_icase && UCHAR_MAX < 4096) /* init tolower lookup table */
- for (ch = 0; ch <= UCHAR_MAX; ch++)
+ for (ch = 0; ch < UCHAR_MAX + 1; ch++)
myctype[ch] = tolower(ch);
/* foreach database ... */
@@ -358,15 +363,15 @@ usage ()
#undef FF_ICASE
#define FF_MMAP
-#include <fastfind.c>
+#include "fastfind.c"
#define FF_ICASE
-#include <fastfind.c>
+#include "fastfind.c"
#endif /* MMAP */
/* fopen */
/* fastfind, fastfind_icase */
#undef FF_MMAP
#undef FF_ICASE
-#include <fastfind.c>
+#include "fastfind.c"
#define FF_ICASE
-#include <fastfind.c>
+#include "fastfind.c"
diff --git a/usr.bin/locate/locate/locate.h b/usr.bin/locate/locate/locate.h
index bc3b518fb90..6eccf8867ee 100644
--- a/usr.bin/locate/locate/locate.h
+++ b/usr.bin/locate/locate/locate.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: locate.h,v 1.6 1996/10/10 09:55:08 michaels Exp $ */
+/* $OpenBSD: locate.h,v 1.7 1996/10/20 00:52:57 michaels Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -41,6 +41,7 @@
#define OFFSET 14 /* abs value of max likely diff */
#define PARITY 0200 /* parity bit */
#define SWITCH 30 /* switch code */
+#define UMLAUT 31 /* an 8 bit char followed */
/* 0-28 likeliest differential counts + offset to make nonnegative */
#define LDC_MIN 0
diff --git a/usr.bin/locate/locate/updatedb.sh b/usr.bin/locate/locate/updatedb.sh
index eb76b5f6926..604dbbe88b2 100644
--- a/usr.bin/locate/locate/updatedb.sh
+++ b/usr.bin/locate/locate/updatedb.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $OpenBSD: updatedb.sh,v 1.3 1996/09/15 23:38:39 deraadt Exp $
+# $OpenBSD: updatedb.sh,v 1.4 1996/10/20 00:52:58 michaels Exp $
#
# Copyright (c) September 1995 Wolfram Schneider <wosch@FreeBSD.org>. Berlin.
# All rights reserved.
@@ -28,7 +28,7 @@
#
# updatedb - update locate database for local mounted filesystems
#
-# $Id: updatedb.sh,v 1.3 1996/09/15 23:38:39 deraadt Exp $
+# $Id: updatedb.sh,v 1.4 1996/10/20 00:52:58 michaels Exp $
LOCATE_CONFIG="/etc/locate.rc"
if [ -f "$LOCATE_CONFIG" -a -r "$LOCATE_CONFIG" ]; then
@@ -37,6 +37,7 @@ fi
# The directory containing locate subprograms
: ${LIBEXECDIR=/usr/libexec}; export LIBEXECDIR
+: ${TMPDIR=/tmp}; export TMPDIR
PATH=$LIBEXECDIR:/bin:/usr/bin:$PATH; export PATH