- Fix broken magic files discovered by that test.
-2013-01-10 11:20 Christos Zoulas <christos@zoulas.com>
+2013-01-10 11:40 Christos Zoulas <christos@zoulas.com>
+
+ * Warn about inconsistent continuation levels.
+
+2013-01-10 21:00 Christos Zoulas <christos@zoulas.com>
* Make getline public so that file can link against it.
Perhaps it is better to rename it, or hide it differently.
Fixes builds on platforms that do not provide it.
-2013-01-07 11:20 Christos Zoulas <christos@zoulas.com>
+2013-01-07 16:30 Christos Zoulas <christos@zoulas.com>
* Add SuS d{,1,2,4,8}, u{,1,2,4,8} and document
what long, int, short, etc is (Guy Harris)
#------------------------------------------------------------------------------
-# $File: cafebabe,v 1.11 2013/01/04 23:27:55 christos Exp $
+# $File: cafebabe,v 1.12 2013/01/11 16:45:23 christos Exp $
# Cafe Babes unite!
#
# Since Java bytecode and Mach-O universal binaries have the same magic number,
>>4 belong 0x0032 (Java 1.6)
0 belong 0xcafed00d JAR compressed with pack200,
->>5 byte x version %d.
->>4 byte x \b%d
+>5 byte x version %d.
+>4 byte x \b%d
!:mime application/x-java-pack200
0 belong 0xcafed00d JAR compressed with pack200,
->>5 byte x version %d.
->>4 byte x \b%d
+>5 byte x version %d.
+>4 byte x \b%d
!:mime application/x-java-pack200
### JAVA END ###
#------------------------------------------------------------------------------
-# $File: digital,v 1.10 2011/05/03 01:44:17 christos Exp $
+# $File: digital,v 1.11 2013/01/11 16:45:23 christos Exp $
# Digital UNIX - Info
#
0 string =!<arch>\n________64E Alpha archive
#
0 leshort 0603
->>24 leshort 0410 COFF format alpha pure
->>24 leshort 0413 COFF format alpha demand paged
->>>22 leshort&030000 !020000 executable
->>>22 leshort&020000 !0 dynamically linked
->>>16 lelong !0 not stripped
->>>16 lelong 0 stripped
->>>27 byte x - version %d
->>>26 byte x \b.%d
->>>28 byte x \b-%d
->>24 leshort 0407 COFF format alpha object
->>>22 leshort&030000 020000 shared library
->>>27 byte x - version %d
->>>26 byte x \b.%d
->>>28 byte x \b-%d
+>24 leshort 0410 COFF format alpha pure
+>24 leshort 0413 COFF format alpha demand paged
+>>22 leshort&030000 !020000 executable
+>>22 leshort&020000 !0 dynamically linked
+>>16 lelong !0 not stripped
+>>16 lelong 0 stripped
+>>27 byte x - version %d
+>>26 byte x \b.%d
+>>28 byte x \b-%d
+>24 leshort 0407 COFF format alpha object
+>>22 leshort&030000 020000 shared library
+>>27 byte x - version %d
+>>26 byte x \b.%d
+>>28 byte x \b-%d
# Basic recognition of Digital UNIX core dumps - Mike Bremford <mike@opac.bl.uk>
#
#------------------------------------------------------------------------------
-# $File: maple,v 1.6 2009/09/19 16:28:10 christos Exp $
+# $File: maple,v 1.7 2013/01/11 16:45:23 christos Exp $
# maple: file(1) magic for maple files
# "H. Nanosecond" <aldomel@ix.netcom.com>
# Maple V release 4, a multi-purpose math program
# that is {VERSION major_version miunor_version computer_type version_string}
0 string {VERSION\ Maple worksheet
>9 string >\0 version %.1s.
->>>11 string >\0 %.1s
+>>11 string >\0 %.1s
# .mps
0 string \0\0\001$ Maple something
#------------------------------------------------------------------------------
-# $File: rpm,v 1.11 2011/06/14 12:47:41 christos Exp $
+# $File: rpm,v 1.12 2013/01/11 16:45:23 christos Exp $
#
# RPM: file(1) magic for Red Hat Packages Erik Troan (ewt@redhat.com)
#
>>8 beshort 255 noarch
#delta RPM Daniel Novotny (dnovotny@redhat.com)
-0 string drpm Delta RPM
+0 string drpm Delta RPM
!:mime application/x-rpm
>12 string x %s
-
->>>8 beshort 11 MIPSel
->>>8 beshort 12 ARM
->>>8 beshort 13 MiNT
->>>8 beshort 14 S/390
->>>8 beshort 15 S/390x
->>>8 beshort 16 PowerPC64
->>>8 beshort 17 SuperH
->>>8 beshort 18 Xtensa
+>>8 beshort 11 MIPSel
+>>8 beshort 12 ARM
+>>8 beshort 13 MiNT
+>>8 beshort 14 S/390
+>>8 beshort 15 S/390x
+>>8 beshort 16 PowerPC64
+>>8 beshort 17 SuperH
+>>8 beshort 18 Xtensa
>>10 string x %s
-
-# Type: Delta RPM
-# From: Daniel Novotny (dnovotny@redhat.com)
-0 string drpm Delta RPM
-!:mime application/x-rpm
->12 string x %s
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: apprentice.c,v 1.188 2013/01/09 15:36:55 christos Exp $")
+FILE_RCSID("@(#)$File: apprentice.c,v 1.189 2013/01/11 16:45:23 christos Exp $")
#endif /* lint */
#include "magic.h"
char *t;
int op;
uint32_t cont_level;
+ int32_t diff;
cont_level = 0;
file_magerror(ms, "No current entry for continuation");
return -1;
}
+ if (me->cont_count == 0) {
+ file_magerror(ms, "Continuations present with 0 count");
+ return -1;
+ }
+ m = &me->mp[me->cont_count - 1];
+ diff = (int32_t)cont_level - (int32_t)m->cont_level;
+ if (diff > 1)
+ file_magwarn(ms, "New continuation level %u is more "
+ "than one larger than current level %u", cont_level,
+ m->cont_level);
if (me->cont_count == me->max_count) {
struct magic *nm;
size_t cnt = me->max_count + ALLOC_CHUNK;