summaryrefslogtreecommitdiffstats
path: root/usr.bin/file/apprentice.c
diff options
context:
space:
mode:
authormpp <mpp@FreeBSD.org>1997-03-18 19:37:41 +0000
committermpp <mpp@FreeBSD.org>1997-03-18 19:37:41 +0000
commitc80207ab497d53f6b4e875029804295bbed9cb56 (patch)
tree8d23040c7ea9ff0f9d863cc3a1849433228224f2 /usr.bin/file/apprentice.c
parentb15d6bfc2978bb74d2f16e720b496d73d2da89f2 (diff)
downloadFreeBSD-src-c80207ab497d53f6b4e875029804295bbed9cb56.zip
FreeBSD-src-c80207ab497d53f6b4e875029804295bbed9cb56.tar.gz
Merge to resolve conflicts with file 3.22 merge.
Diffstat (limited to 'usr.bin/file/apprentice.c')
-rw-r--r--usr.bin/file/apprentice.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/usr.bin/file/apprentice.c b/usr.bin/file/apprentice.c
index 4b9ee21..9b358c1 100644
--- a/usr.bin/file/apprentice.c
+++ b/usr.bin/file/apprentice.c
@@ -33,8 +33,8 @@
#include "file.h"
#ifndef lint
-static char *moduleid =
- "@(#)$Id$";
+static char *moduleid =
+ "@(#)$Id: apprentice.c,v 1.1.1.3 1997/03/18 17:58:42 mpp Exp $";
#endif /* lint */
#define EATAB {while (isascii((unsigned char) *l) && \
@@ -133,10 +133,10 @@ int check; /* non-zero? checking-only run. */
/*
* extend the sign bit if the comparison is to be signed
*/
-unsigned long
+uint32
signextend(m, v)
struct magic *m;
-unsigned long v;
+uint32 v;
{
if (!(m->flag & UNSIGNED))
switch(m->type) {
@@ -159,7 +159,7 @@ unsigned long v;
case LONG:
case BELONG:
case LELONG:
- v = (long) v;
+ v = (int32) v;
break;
case STRING:
break;
@@ -210,6 +210,10 @@ int *ndx, check;
++l; /* step over */
m->flag |= INDIR;
}
+ if (m->cont_level != 0 && *l == '&') {
+ ++l; /* step over */
+ m->flag |= ADD;
+ }
/* get offset, then skip over it */
m->offset = (int) strtoul(l,&t,0);
@@ -491,21 +495,16 @@ int plen, *slen;
*p++ = (char)val;
break;
- /* \x and up to 3 hex digits */
+ /* \x and up to 2 hex digits */
case 'x':
val = 'x'; /* Default if no digits */
c = hextoint(*s++); /* Get next char */
if (c >= 0) {
val = c;
c = hextoint(*s++);
- if (c >= 0) {
+ if (c >= 0)
val = (val << 4) + c;
- c = hextoint(*s++);
- if (c >= 0) {
- val = (val << 4) + c;
- } else
- --s;
- } else
+ else
--s;
} else
--s;
OpenPOWER on IntegriCloud