summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/file/apprentice.c9
-rw-r--r--usr.bin/file/file.h4
2 files changed, 7 insertions, 6 deletions
diff --git a/usr.bin/file/apprentice.c b/usr.bin/file/apprentice.c
index ee3ffa4..041ead0 100644
--- a/usr.bin/file/apprentice.c
+++ b/usr.bin/file/apprentice.c
@@ -27,7 +27,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id$";
+ "$Id: apprentice.c,v 1.7 1998/01/28 07:36:21 charnier Exp $";
#endif /* not lint */
#include <ctype.h>
@@ -50,6 +50,7 @@ static int parse __P((char *, int *, int));
static void eatsize __P((char **));
static int maxmagic = 0;
+static int alloc_incr = 256;
static int apprentice_1 __P((char *, int));
@@ -180,9 +181,8 @@ int *ndx, check;
struct magic *m;
char *t, *s;
-#define ALLOC_INCR 20
if (nd+1 >= maxmagic){
- maxmagic += ALLOC_INCR;
+ maxmagic += alloc_incr;
if ((magic = (struct magic *) realloc(magic,
sizeof(struct magic) *
maxmagic)) == NULL) {
@@ -192,7 +192,8 @@ int *ndx, check;
else
exit(1);
}
- memset(&magic[*ndx], 0, sizeof(struct magic) * ALLOC_INCR);
+ memset(&magic[*ndx], 0, sizeof(struct magic) * alloc_incr);
+ alloc_incr *= 2;
}
m = &magic[*ndx];
m->flag = 0;
diff --git a/usr.bin/file/file.h b/usr.bin/file/file.h
index be326a5..d62942e 100644
--- a/usr.bin/file/file.h
+++ b/usr.bin/file/file.h
@@ -1,6 +1,6 @@
/*
* file.h - definitions for file(1) program
- * @(#)$Id: file.h,v 1.7 1997/03/18 19:37:18 mpp Exp $
+ * @(#)$Id: file.h,v 1.8 1998/01/28 07:36:23 charnier Exp $
*
* Copyright (c) Ian F. Darwin, 1987.
* Written by Ian F. Darwin.
@@ -35,7 +35,7 @@ typedef unsigned int uint32;
#ifndef HOWMANY
# define HOWMANY 8192 /* how much of the file to look at */
#endif
-#define MAXMAGIS 1000 /* max entries in /etc/magic */
+#define MAXMAGIS 5000 /* max entries in /etc/magic */
#define MAXDESC 50 /* max leng of text description */
#define MAXstring 32 /* max leng of "string" types */
OpenPOWER on IntegriCloud