]> git.pld-linux.org Git - packages/file.git/blame - file-debian.patch
- updated to file-4.05
[packages/file.git] / file-debian.patch
CommitLineData
f8c6f9ed
AM
1--- file-4.04.orig/doc/Makefile.in
2+++ file-4.04/doc/Makefile.in
3@@ -52,6 +52,7 @@
4 CYGPATH_W = @CYGPATH_W@
5 DEFS = @DEFS@
6 DEPDIR = @DEPDIR@
7+ECHO = @ECHO@
8 ECHO_C = @ECHO_C@
9 ECHO_N = @ECHO_N@
10 ECHO_T = @ECHO_T@
11@@ -129,6 +130,7 @@
12 EXTRA_DIST = file.man magic.man libmagic.man
13 CLEANFILES = $(man_MANS)
14 subdir = doc
15+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
16 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
17 CONFIG_HEADER = $(top_builddir)/config.h
18 CONFIG_CLEAN_FILES =
19@@ -387,7 +389,6 @@
20
21 installdirs:
22 $(mkinstalldirs) $(DESTDIR)$(man1dir) $(DESTDIR)$(man3dir) $(DESTDIR)$(man4dir) $(DESTDIR)$(man5dir)
23-
24 install: install-am
25 install-exec: install-exec-am
26 install-data: install-data-am
27--- file-4.04.orig/doc/file.man
28+++ file-4.04/doc/file.man
29@@ -1,4 +1,4 @@
30-.TH FILE __CSECTION__ "Copyright but distributable"
31+.TH FILE __CSECTION__ "July 2003" "Debian/GNU Linux" "Copyrighted but distributable"
32 .\" $Id$
33 .SH NAME
34 file
35@@ -56,10 +56,9 @@
36 meaning anything else (data is usually `binary' or non-printable).
37 Exceptions are well-known file formats (core files, tar archives)
38 that are known to contain binary data.
39-When modifying the file
40-.I __MAGIC__
41-or the program itself,
42-.B "preserve these keywords" .
43+When adding local definitions to
44+.IR /etc/magic ,
45+.BR "preserve these keywords" .
46 People depend on knowing that all the readable files in a directory
47 have the word ``text'' printed.
48 Don't do as Berkeley did and change ``shell commands text''
49@@ -98,7 +97,9 @@
50 The concept of `magic number' has been applied by extension to data files.
51 Any file with some invariant identifier at a small fixed
52 offset into the file can usually be described in this way.
53-The information identifying these files is read from the compiled
54+The information identifying these files is read from
55+.I /etc/magic
56+and the compiled
57 magic file
58 .I __MAGIC__.mgc ,
59 or
60@@ -330,12 +331,6 @@
61 The order of entries in the magic file is significant.
62 Depending on what system you are using, the order that
63 they are put together may be incorrect.
64-If your old
65-.B file
66-command uses a magic file,
67-keep the old magic file around for comparison purposes
68-(rename it to
69-.IR __MAGIC__.orig ).
70 .SH EXAMPLES
71 .nf
72 $ file file.c file /dev/{wd0a,hda}
73@@ -489,3 +484,10 @@
74 .B ftp.astron.com
75 in the directory
76 .I /pub/file/file-X.YZ.tar.gz
77+.PP
78+This
79+.B Debian
80+version adds a number of new magix entries. It can be
81+obtained from every site carrying a
82+.B Debian
83+distribution (ftp.debian.org and mirrors).
84--- file-4.04.orig/src/Makefile.am
85+++ file-4.04/src/Makefile.am
86@@ -4,7 +4,7 @@
87
88 bin_PROGRAMS = file
89
90-AM_CPPFLAGS = -DMAGIC='"$(MAGIC)"'
91+AM_CPPFLAGS = -DMAGIC='"/etc/magic:$(MAGIC)"'
92
93 libmagic_la_SOURCES = magic.c apprentice.c softmagic.c ascmagic.c \
94 compress.c is_tar.c readelf.c print.c fsmagic.c \
95--- file-4.04.orig/src/Makefile.in
96+++ file-4.04/src/Makefile.in
97@@ -52,6 +52,7 @@
98 CYGPATH_W = @CYGPATH_W@
99 DEFS = @DEFS@
100 DEPDIR = @DEPDIR@
101+ECHO = @ECHO@
102 ECHO_C = @ECHO_C@
103 ECHO_N = @ECHO_N@
104 ECHO_T = @ECHO_T@
105@@ -127,7 +128,7 @@
106
107 bin_PROGRAMS = file
108
109-AM_CPPFLAGS = -DMAGIC='"$(MAGIC)"'
110+AM_CPPFLAGS = -DMAGIC='"/etc/magic:$(MAGIC)"'
111
112 libmagic_la_SOURCES = magic.c apprentice.c softmagic.c ascmagic.c \
113 compress.c is_tar.c readelf.c print.c fsmagic.c \
114@@ -138,6 +139,7 @@
115 file_SOURCES = file.c
116 file_LDFLAGS = -lmagic
117 subdir = src
118+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
119 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
120 CONFIG_HEADER = $(top_builddir)/config.h
121 CONFIG_CLEAN_FILES =
122@@ -276,7 +278,7 @@
123 .c.o:
124 @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
125 @am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
126-@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
127+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
128 @am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
129 @am__fastdepCC_TRUE@ fi
130 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
131@@ -287,7 +289,7 @@
132 .c.obj:
133 @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
134 @am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
135-@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
136+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
137 @am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
138 @am__fastdepCC_TRUE@ fi
139 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
140@@ -298,7 +300,7 @@
141 .c.lo:
142 @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
143 @am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
144-@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \
145+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \
146 @am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
147 @am__fastdepCC_TRUE@ fi
148 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
149@@ -427,7 +429,6 @@
150
151 installdirs:
152 $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(bindir) $(DESTDIR)$(includedir)
153-
154 install: install-am
155 install-exec: install-exec-am
156 install-data: install-data-am
157--- file-4.04.orig/src/apprentice.c
158+++ file-4.04/src/apprentice.c
159@@ -81,6 +81,10 @@
160 char PATHSEP=':';
161 #endif
162
163+#ifndef MAXPATHLEN
164+#define MAXPATHLEN 512
165+#endif
166+
167
168 private int getvalue(struct magic_set *ms, struct magic *, char **);
169 private int hextoint(int);
170--- file-4.04.orig/src/ascmagic.c
171+++ file-4.04/src/ascmagic.c
172@@ -41,8 +41,8 @@
173 * international characters, now subsumed into this file.
174 */
175
176-#include "magic.h"
177 #include "file.h"
178+#include "magic.h"
179 #include <stdio.h>
180 #include <string.h>
181 #include <memory.h>
182--- file-4.04.orig/src/compress.c
183+++ file-4.04/src/compress.c
184@@ -37,8 +37,8 @@
185 * uncompress(method, old, n, newch) - uncompress old into new,
186 * using method, return sizeof new
187 */
188-#include "magic.h"
189 #include "file.h"
190+#include "magic.h"
191 #include <stdio.h>
192 #include <stdlib.h>
193 #ifdef HAVE_UNISTD_H
194@@ -360,9 +360,23 @@
195 default: /* parent */
196 (void) close(fdin[0]);
197 (void) close(fdout[1]);
198- if (swrite(fdin[1], old, n) != (ssize_t)n) {
199- n = 0;
200- goto err;
201+ /* fork again, to avoid blocking because both pipes filled */
202+ switch (fork()) {
203+ case 0: /* child */
204+ (void) close(fdout[0]);
205+ /*fprintf(stderr, "about to write %d bytes to pipe\n", n);*/
206+ if (swrite(fdin[1], old, n) != n) {
207+ exit(1);
208+ }
209+ exit(0);
210+ /*NOTREACHED*/
211+ case -1:
212+ error("could not fork (%s).\n", strerror(errno));
213+ /*NOTREACHED*/
214+
215+ /* default: // parent
216+ fall through */
217+
218 }
219 (void) close(fdin[1]);
220 fdin[1] = -1;
221@@ -372,7 +386,8 @@
222 }
223 if ((r = sread(fdout[0], *newch, HOWMANY)) <= 0) {
224 free(*newch);
225- r = 0;
226+ *newch = NULL;
227+ n = 0;
228 goto err;
229 } else {
230 n = r;
231@@ -383,7 +398,9 @@
232 if (fdin[1] != -1)
233 (void) close(fdin[1]);
234 (void) close(fdout[0]);
235- (void) wait(NULL);
236+ /*(void) wait(NULL);*/
237+ /* reap any terminated children, but don't wait for them. */
238+ while (waitpid(-1, NULL, WNOHANG) > 0);
239 return n;
240 }
241 }
242--- file-4.04.orig/src/file.c
243+++ file-4.04/src/file.c
244@@ -34,8 +34,8 @@
245 * file - find type of a file or files - main program.
246 */
247
248-#include "magic.h"
249 #include "file.h"
250+#include "magic.h"
251
252 #include <stdio.h>
253 #include <stdlib.h>
254@@ -62,6 +62,10 @@
255 #ifdef HAVE_LOCALE_H
256 #include <locale.h>
257 #endif
258+#ifdef HAVE_WCHAR_H
259+#include <wchar.h>
260+#include <assert.h>
261+#endif
262
263 #ifdef HAVE_GETOPT_H
264 #include <getopt.h> /* for long options (is this portable?)*/
265@@ -256,9 +260,8 @@
266 flags |= MAGIC_DEVICES;
267 break;
268 case 'v':
269- (void) fprintf(stdout, "%s-%d.%.2d\n", progname,
270- FILE_VERSION_MAJOR, patchlevel);
271- (void) fprintf(stdout, "magic file from %s\n",
272+ (void) fprintf(stdout, "%s-"VERSION"\n", progname);
273+ (void) fprintf(stdout, "magic data from %s\n",
274 magicfile);
275 return 1;
276 case 'z':
277@@ -304,7 +307,7 @@
278 else {
279 int i, wid, nw;
280 for (wid = 0, i = optind; i < argc; i++) {
281- nw = strlen(argv[i]);
282+ nw = file_mbswidth(argv[i]);
283 if (nw > wid)
284 wid = nw;
285 }
286@@ -354,7 +357,7 @@
287 }
288
289 while (fgets(buf, MAXPATHLEN, f) != NULL) {
290- cwid = strlen(buf) - 1;
291+ cwid = file_mbswidth(buf) - 1;
292 if (cwid > wid)
293 wid = cwid;
294 }
295@@ -380,7 +383,8 @@
296
297 if (wid > 0 && !bflag)
298 (void) printf("%s%s%*s ", std_in ? "/dev/stdin" : inname,
299- separator, (int) (nopad ? 0 : (wid - strlen(inname))), "");
300+ separator, (int) (nopad ? 0 : (wid - file_mbswidth(inname))), ""),
301+ fflush(stdout);
302
303 type = magic_file(magic, std_in ? NULL : inname);
304 if (type == NULL)
305@@ -488,3 +492,39 @@
306 exit(0);
307 }
308 #endif
309+
310+/* Return the screen width of the given string.
311+ * We assume it's multi-byte and in the current locale.
312+ * If it's not, the value we get will be at least as good
313+ * as the value you get by just calling strlen() */
314+size_t
315+file_mbswidth(const char *s)
316+{
317+#ifdef HAVE_WCHAR_H
318+ size_t bytesconsumed, old_n, n, width = 0;
319+ mbstate_t state;
320+ wchar_t nextchar;
321+ memset(&state, 0, sizeof(mbstate_t));
322+ old_n = n = strlen(s);
323+
324+ while (n>0) {
325+ bytesconsumed = mbrtowc(&nextchar, s, n, &state);
326+ if (bytesconsumed == (size_t)(-1) || bytesconsumed == (size_t)(-2)) {
327+ /* Something went wrong, return something reasonable */
328+ return old_n;
329+ }
330+ if (s[0]=='\n')
331+ /* do what strlen() would do, so that caller is always right */
332+ width++;
333+ else
334+ width += wcwidth(nextchar);
335+
336+ s += bytesconsumed, n -= bytesconsumed;
337+ }
338+ return width;
339+
340+#else
341+ return strlen(s);
342+#endif
343+}
344+
345--- file-4.04.orig/src/file.h
346+++ file-4.04/src/file.h
347@@ -198,6 +198,7 @@
348 protected void file_magwarn(const char *, ...);
349 protected void file_mdump(struct magic *);
350 protected void file_showstr(FILE *, const char *, size_t);
351+protected size_t file_mbswidth(const char *);
352
353 #ifndef HAVE_STRERROR
354 extern int sys_nerr;
355--- file-4.04.orig/src/funcs.c
356+++ file-4.04/src/funcs.c
357@@ -26,8 +26,8 @@
358 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
359 * SUCH DAMAGE.
360 */
361-#include "magic.h"
362 #include "file.h"
363+#include "magic.h"
364 #include <stdarg.h>
365 #include <stdlib.h>
366 #include <string.h>
367--- file-4.04.orig/src/is_tar.c
368+++ file-4.04/src/is_tar.c
369@@ -42,8 +42,8 @@
370 * for file command by Ian Darwin.
371 */
372
373-#include "magic.h"
374 #include "file.h"
375+#include "magic.h"
376 #include <string.h>
377 #include <ctype.h>
378 #include <sys/types.h>
379--- file-4.04.orig/src/magic.c
380+++ file-4.04/src/magic.c
381@@ -27,8 +27,8 @@
382 * SUCH DAMAGE.
383 */
384
385-#include "magic.h"
386 #include "file.h"
387+#include "magic.h"
388
389 #include <stdio.h>
390 #include <stdlib.h>
391@@ -251,11 +251,24 @@
392 else if ((fd = open(inname, O_RDONLY)) < 0) {
393 /* We can't open it, but we were able to stat it. */
394 if (sb.st_mode & 0002)
395- if (file_printf(ms, "writable, ") == -1)
396+ if (file_printf(ms, "writable, ") == -1) {
397+ close(fd);
398 return NULL;
399+ }
400 if (sb.st_mode & 0111)
401- if (file_printf(ms, "executable, ") == -1)
402+ if (file_printf(ms, "executable, ") == -1) {
403+ close(fd);
404+ return NULL;
405+ }
406+ if (sb.st_mode & 0100000)
407+ if (file_printf(ms, "regular file, ") == -1) {
408+ close(fd);
409 return NULL;
410+ }
411+ if (file_printf(ms, "no read permission") == -1) {
412+ close(fd);
413+ return NULL;
414+ }
415 return ms->o.buf;
416 }
417
418@@ -273,6 +286,10 @@
419 (void)close(fd);
420 goto done;
421 }
422+ } else if (nbytes == 1) {
423+ file_printf(ms, "very short file (no magic)");
424+ (void)close(fd);
425+ return ms->o.buf;
426 } else {
427 buf[nbytes++] = '\0'; /* null-terminate it */
428 #ifdef __EMX__
429--- file-4.04.orig/src/names.h
430+++ file-4.04/src/names.h
431@@ -60,6 +60,7 @@
432 #define L_HTML 11 /* HTML */
433 #define L_BCPL 12 /* BCPL */
434 #define L_M4 13 /* M4 */
435+#define L_PO 14 /* PO */
436
437 static const struct {
438 const char *human;
439@@ -71,7 +72,7 @@
440 { "make commands", "text/x-makefile" },
441 { "PL/1 program", "text/x-pl1" },
442 { "assembler program", "text/x-asm" },
443- { "English", "text/plain, English" },
444+ { "English", "text/plain" },
445 { "Pascal program", "text/x-pascal" },
446 { "mail", "text/x-mail" },
447 { "news", "text/x-news" },
448@@ -79,6 +80,7 @@
449 { "HTML document", "text/html", },
450 { "BCPL program", "text/x-bcpl" },
451 { "M4 macro language pre-processor", "text/x-m4" },
452+ { "PO (gettext message catalogue)", "text/x-po" },
453 { "can't happen error on names.h/types", "error/x-error" },
454 { 0, 0}
455 };
456@@ -125,6 +127,7 @@
457 } names[] = {
458 /* These must be sorted by eye for optimal hit rate */
459 /* Add to this list only after substantial meditation */
460+ {"msgid", L_PO},
461 {"dnl", L_M4},
462 {"import", L_JAVA},
463 {"\"libhdr\"", L_BCPL},
464--- file-4.04.orig/Makefile.in
465+++ file-4.04/Makefile.in
466@@ -52,6 +52,7 @@
467 CYGPATH_W = @CYGPATH_W@
468 DEFS = @DEFS@
469 DEPDIR = @DEPDIR@
470+ECHO = @ECHO@
471 ECHO_C = @ECHO_C@
472 ECHO_N = @ECHO_N@
473 ECHO_T = @ECHO_T@
474@@ -275,9 +276,15 @@
475 $(TAGS_FILES) $(LISP)
476 tags=; \
477 here=`pwd`; \
478+ if (etags --etags-include --version) >/dev/null 2>&1; then \
479+ include_option=--etags-include; \
480+ else \
481+ include_option=--include; \
482+ fi; \
483 list='$(SUBDIRS)'; for subdir in $$list; do \
484 if test "$$subdir" = .; then :; else \
485- test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
486+ test -f $$subdir/TAGS && \
487+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
488 fi; \
489 done; \
490 list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
491@@ -420,7 +427,7 @@
492 @echo "$(distdir).tar.gz is ready for distribution" | \
493 sed 'h;s/./=/g;p;x;p;x'
494 distuninstallcheck:
495- cd $(distuninstallcheck_dir) \
496+ @cd $(distuninstallcheck_dir) \
497 && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
498 || { echo "ERROR: files left after uninstall:" ; \
499 if test -n "$(DESTDIR)"; then \
500@@ -429,11 +436,11 @@
501 $(distuninstallcheck_listfiles) ; \
502 exit 1; } >&2
503 distcleancheck: distclean
504- if test '$(srcdir)' = . ; then \
505+ @if test '$(srcdir)' = . ; then \
506 echo "ERROR: distcleancheck can only run from a VPATH build" ; \
507 exit 1 ; \
508 fi
509- test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
510+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
511 || { echo "ERROR: files left in build directory after distclean:" ; \
512 $(distcleancheck_listfiles) ; \
513 exit 1; } >&2
514@@ -496,7 +503,7 @@
515
516 maintainer-clean: maintainer-clean-recursive
517 -rm -f $(am__CONFIG_DISTCLEAN_FILES)
518- -rm -rf autom4te.cache
519+ -rm -rf $(top_srcdir)/autom4te.cache
520 maintainer-clean-am: distclean-am maintainer-clean-generic
521
522 mostlyclean: mostlyclean-recursive
523--- file-4.04.orig/magic/Header
524+++ file-4.04/magic/Header
525@@ -1,5 +1,5 @@
526-# Magic
527 # Magic data for file(1) command.
528-# Machine-generated from src/cmd/file/magdir/*; edit there only!
529-# Format is described in magic(files), where:
530-# files is 5 on V7 and BSD, 4 on SV, and ?? in the SVID.
531+# Format is described in magic(5).
532+# Don't edit this file, edit /etc/magic or send your suggested inclusions to
533+# this file as a wishlist bug against file (using the reportbug utility).
534+
535--- file-4.04.orig/magic/Magdir/amigaos
536+++ file-4.04/magic/Magdir/amigaos
537@@ -33,7 +33,8 @@
538 0 string ARP. The Holy Noise Module sound file
539 0 string BeEp\0 JamCracker Module sound file
540 0 string COSO\0 Hippel-COSO Module sound file
541-26 string V.3 Brian Postma's Soundmon Module sound file v3
542-26 string BPSM Brian Postma's Soundmon Module sound file v3
543-26 string V.2 Brian Postma's Soundmon Module sound file v2
544+# Too simple (short, pure ASCII, deep), MPi
545+#26 string V.3 Brian Postma's Soundmon Module sound file v3
546+#26 string BPSM Brian Postma's Soundmon Module sound file v3
547+#26 string V.2 Brian Postma's Soundmon Module sound file v2
548
549--- file-4.04.orig/magic/Magdir/archive
550+++ file-4.04/magic/Magdir/archive
551@@ -35,7 +35,7 @@
552 >68 string >\0 (format %s)
553 >81 string bz2 \b, uses bzip2 compression
554 >84 string gz \b, uses gzip compression
555->136 ledate x created: %s
556+#>136 ledate x created: %s
557
558 # other archives
559 0 long 0177555 very old archive
560--- file-4.04.orig/magic/Magdir/audio
561+++ file-4.04/magic/Magdir/audio
562@@ -333,3 +333,6 @@
563 0 string A#S#C#S#S#L#V#3 Synthesizer Generator or Kimwitu data
564 # Kimwitu++ uses a slightly different magic
565 0 string A#S#C#S#S#L#HUB Kimwitu++ data
566+
567+# From "Simon Hosie
568+0 string TFMX-SONG TFMX module sound data
569--- file-4.04.orig/magic/Magdir/c-lang
570+++ file-4.04/magic/Magdir/c-lang
571@@ -10,7 +10,7 @@
572 # this first will upset you if you're a PL/1 shop...
573 # in which case rm it; ascmagic will catch real C programs
574 #0 string /* C or REXX program text
575-0 string // C++ program text
576+#0 string // C++ program text
577
578 # From: Mikhail Teterin <mi@aldan.algebra.com>
579 0 string cscope cscope reference data
580--- file-4.04.orig/magic/Magdir/console
581+++ file-4.04/magic/Magdir/console
582@@ -119,9 +119,37 @@
583
584 #------------------------------------------------------------------------------
585 # msx: file(1) magic for MSX game cartridge dumps
586-0 beshort 0x4142 MSX game cartridge dump
587+# Too simple - MPi
588+#0 beshort 0x4142 MSX game cartridge dump
589
590+#------------------------------------------------------------------------------
591 # Sony Playstation executables (Adam Sjoegren <asjo@diku.dk>) :
592 0 string PS-X\ EXE Sony Playstation executable
593 # Area:
594 >113 string x (%s)
595+
596+#------------------------------------------------------------------------------
597+# Microsoft Xbox executables .xbe (Esa Hyytiä <ehyytia@cc.hut.fi>)
598+0 string XBEH XBE, Microsoft Xbox executable
599+# probabilistic checks whether signed or not
600+>0x0004 ulelong =0x0
601+>>&2 ulelong =0x0
602+>>>&2 ulelong =0x0 \b, not signed
603+>0x0004 ulelong >0
604+>>&2 ulelong >0
605+>>>&2 ulelong >0 \b, signed
606+# expect base address of 0x10000
607+>0x0104 ulelong =0x10000
608+>>(0x0118-0x0FF60) ulelong&0x80000007 0x80000007 \b, all regions
609+>>(0x0118-0x0FF60) ulelong&0x80000007 !0x80000007
610+>>>(0x0118-0x0FF60) ulelong >0 (regions:
611+>>>>(0x0118-0x0FF60) ulelong &0x00000001 NA
612+>>>>(0x0118-0x0FF60) ulelong &0x00000002 Japan
613+>>>>(0x0118-0x0FF60) ulelong &0x00000004 Rest_of_World
614+>>>>(0x0118-0x0FF60) ulelong &0x80000000 Manufacturer
615+>>>(0x0118-0x0FF60) ulelong >0 \b)
616+
617+# --------------------------------
618+# Microsoft Xbox data file formats
619+0 string XIP0 XIP, Microsoft Xbox data
620+0 string XTF0 XTF, Microsoft Xbox data
621--- file-4.04.orig/magic/Magdir/database
622+++ file-4.04/magic/Magdir/database
623@@ -192,4 +192,12 @@
624 2 string ICE ICE authority data
625
626 # X11 Xauthority file (Wolfram Kleff)
627+10 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
628+11 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
629+12 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
630+13 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
631 14 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
632+15 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
633+16 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
634+17 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
635+18 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
636--- file-4.04.orig/magic/Magdir/flash
637+++ file-4.04/magic/Magdir/flash
638@@ -8,6 +8,8 @@
639 #
640 0 string FWS Macromedia Flash data,
641 >3 byte x version %d
642+0 string CWS Macromedia Flash data (compressed),
643+>3 byte x version %d
644 #
645 # From Dave Wilson
646 0 string AGD4\xbe\xb8\xbb\xcb\x00 Macromedia Freehand 9 Document
647--- file-4.04.orig/magic/Magdir/human68k
648+++ file-4.04/magic/Magdir/human68k
649@@ -2,18 +2,18 @@
650 #------------------------------------------------------------------------------
651 # human68k: file(1) magic for Human68k (X680x0 DOS) binary formats
652
653-0 string HU Human68k
654->68 string LZX LZX compressed
655->>72 string >\0 (version %s)
656->(8.L+74) string LZX LZX compressed
657->>(8.L+78) string >\0 (version %s)
658->60 belong >0 binded
659->(8.L+66) string #HUPAIR hupair
660->0 string HU X executable
661->(8.L+74) string #LIBCV1 - linked PD LIBC ver 1
662->4 belong >0 - base address 0x%x
663->28 belong >0 not stripped
664->32 belong >0 with debug information
665+#0 string HU Human68k
666+#>68 string LZX LZX compressed
667+#>>72 string >\0 (version %s)
668+#>(8.L+74) string LZX LZX compressed
669+#>>(8.L+78) string >\0 (version %s)
670+#>60 belong >0 binded
671+#>(8.L+66) string #HUPAIR hupair
672+#>0 string HU X executable
673+#>(8.L+74) string #LIBCV1 - linked PD LIBC ver 1
674+#>4 belong >0 - base address 0x%x
675+#>28 belong >0 not stripped
676+#>32 belong >0 with debug information
677 0 beshort 0x601a Human68k Z executable
678 0 beshort 0x6000 Human68k object file
679 0 belong 0xd1000000 Human68k ar binary archive
680--- file-4.04.orig/magic/Magdir/images
681+++ file-4.04/magic/Magdir/images
682@@ -164,10 +164,11 @@
683 >>18 lelong x \b, %d x
684 >>22 lelong x %d x
685 >>28 leshort x %d
686-0 string IC PC icon data
687-0 string PI PC pointer image data
688-0 string CI PC color icon data
689-0 string CP PC color pointer image data
690+# Too simple - MPi
691+#0 string IC PC icon data
692+#0 string PI PC pointer image data
693+#0 string CI PC color icon data
694+#0 string CP PC color pointer image data
695 # Conflicts with other entries [BABYL]
696 #0 string BA PC bitmap array data
697
698--- file-4.04.orig/magic/Magdir/jpeg
699+++ file-4.04/magic/Magdir/jpeg
700@@ -19,9 +19,9 @@
701 >11 byte x \b %d.
702 >12 byte x \b%02d
703 # Next, the resolution or aspect ratio of the image:
704->13 byte 0 \b, aspect ratio
705->13 byte 1 \b, resolution (DPI)
706->13 byte 2 \b, resolution (DPCM)
707+#>13 byte 0 \b, aspect ratio
708+#>13 byte 1 \b, resolution (DPI)
709+#>13 byte 2 \b, resolution (DPCM)
710 #>4 beshort x \b, segment length %d
711 # Next, show thumbnail info, if it exists:
712 >18 byte !0 \b, thumbnail %dx
713@@ -54,8 +54,8 @@
714 # I've commented-out quantisation table reporting. I doubt anyone cares yet.
715 #>(4.S+5) byte 0xDB \b, quantisation table
716 #>>(4.S+6) beshort x \b length=%d
717->14 beshort x \b, %d x
718->16 beshort x \b %d
719+#>14 beshort x \b, %d x
720+#>16 beshort x \b %d
721
722 # HSI is Handmade Software's proprietary JPEG encoding scheme
723 0 string hsi1 JPEG image data, HSI proprietary
724--- file-4.04.orig/magic/Magdir/linux
725+++ file-4.04/magic/Magdir/linux
726@@ -42,13 +42,8 @@
727 #
728 # LILO boot/chain loaders, from Daniel Quinlan <quinlan@yggdrasil.com>
729 # this can be overridden by the DOS executable (COM) entry
730-2 string LILO Linux/i386 LILO boot/chain loader
731-#
732-# Debian Packages, from Peter Tobias <tobias@server.et-inf.fho-emden.de>
733-0 string 0.9
734->8 byte 0x0a old Debian Binary Package
735->>3 byte >0 \b, created by dpkg 0.9%c
736->>4 byte >0 pl%c
737+# Too simple, MPi
738+#2 string LILO Linux/i386 LILO boot/chain loader
739 # PSF fonts, from H. Peter Anvin <hpa@yggdrasil.com>
740 0 leshort 0x0436 Linux/i386 PC Screen Font data,
741 >2 byte 0 256 characters, no directory,
742@@ -102,10 +97,10 @@
743 >0x1e3 string Loading version 1.3.79 or older
744 >0x1e9 string Loading from prehistoric times
745
746-# System.map files - Nicol=EF=BF=BDs Lichtmaier <nick@debian.org>
747