Ticket #11747: file-4.20_unfinished.diff
File file-4.20_unfinished.diff, 8.0 KB (added by pipping@…, 18 years ago) |
---|
-
files/patch-4.20-REG_STARTEND
1 Index: softmagic.c 2 =================================================================== 3 RCS file: /p/file/cvsroot/file/src/softmagic.c,v 4 retrieving revision 1.91 5 retrieving revision 1.95 6 diff -u -r1.91 -r1.95 7 --- softmagic.c 18 Jan 2007 05:29:33 -0000 1.91 8 +++ softmagic.c 3 Mar 2007 19:09:25 -0000 1.95 9 @@ -38,7 +38,7 @@ 10 11 12 #ifndef lint 13 -FILE_RCSID("@(#)$File: softmagic.c,v 1.91 2007/01/18 05:29:33 ljt Exp $") 14 +FILE_RCSID("@(#)$File: softmagic.c,v 1.95 2007/03/03 19:09:25 christos Exp $") 15 #endif /* lint */ 16 17 private int match(struct magic_set *, struct magic *, uint32_t, 18 @@ -1523,10 +1523,20 @@ 19 } 20 else { 21 regmatch_t pmatch[1]; 22 +#ifndef REG_STARTEND 23 +#define REG_STARTEND 0 24 + size_t l = ms->search.s_len - 1; 25 + char c = ms->search.s[l]; 26 + ((char *)(intptr_t)ms->search.s)[l] = '\0'; 27 +#else 28 pmatch[0].rm_so = 0; 29 pmatch[0].rm_eo = ms->search.s_len; 30 +#endif 31 rc = regexec(&rx, (const char *)ms->search.s, 32 1, pmatch, REG_STARTEND); 33 +#if REG_STARTEND == 0 34 + ((char *)(intptr_t)ms->search.s)[l] = c; 35 +#endif 36 switch (rc) { 37 case 0: 38 ms->search.s += (int)pmatch[0].rm_so; -
files/src__file.h.diff_mod
1 --- src/file.h.orig 2007-04-08 05:17:02.000000000 +0200 2 +++ src/file.h 2007-04-08 05:19:11.000000000 +0200 3 @@ -96,11 +96,11 @@ 4 #endif 5 #define MAXMAGIS 8192 /* max entries in /etc/magic */ 6 #define MAXDESC 64 /* max leng of text description */ 7 -#define MAXstring 32 /* max leng of "string" types */ 8 +#define MAXstring 256 /* max leng of "string" types */ 9 10 #define MAGICNO 0xF11E041C 11 #define VERSIONNO 4 12 -#define FILE_MAGICSIZE (32 * 4) 13 +#define FILE_MAGICSIZE (32 * 11) 14 15 #define FILE_LOAD 0 16 #define FILE_CHECK 1 17 @@ -312,6 +312,8 @@ 18 protected int file_reset(struct magic_set *); 19 protected int file_tryelf(struct magic_set *, int, const unsigned char *, 20 size_t); 21 +protected int file_tryfat(struct magic_set *, int, const unsigned char *, 22 + size_t, const char *); 23 protected int file_zmagic(struct magic_set *, int, const char *, 24 const unsigned char *, size_t); 25 protected int file_ascmagic(struct magic_set *, const unsigned char *, size_t); -
files/magic__Makefile.in.diff_mod
1 --- magic/Makefile.in.orig 2007-04-08 05:52:16.000000000 +0200 2 +++ magic/Makefile.in 2007-04-08 05:52:49.000000000 +0200 3 @@ -554,7 +554,8 @@ 4 $(FILE_COMPILE) -C -m magic 5 6 magic.mime.mgc: magic.mime 7 - $(FILE_COMPILE) -C -m $(srcdir)/magic.mime 8 + $(FILE_COMPILE) -C -m magic.mime 9 + cat $(srcdir)/magic.mime > magic.mime 10 # Tell versions [3.59,3.63) of GNU make to not export all variables. 11 # Otherwise a system limit (for SysV at least) may be exceeded. 12 .NOEXPORT: -
files/src__Makefile.in.diff_mod
1 --- src/Makefile.in.orig 2007-04-08 05:11:59.000000000 +0200 2 +++ src/Makefile.in 2007-04-08 05:14:16.000000000 +0200 3 @@ -62,8 +62,8 @@ 4 LTLIBRARIES = $(lib_LTLIBRARIES) 5 libmagic_la_LIBADD = 6 am_libmagic_la_OBJECTS = magic.lo apprentice.lo softmagic.lo \ 7 - ascmagic.lo compress.lo is_tar.lo readelf.lo print.lo \ 8 - fsmagic.lo funcs.lo apptype.lo 9 + ascmagic.lo compress.lo is_tar.lo readelf.lo readfat.lo \ 10 + print.lo fsmagic.lo funcs.lo apptype.lo 11 libmagic_la_OBJECTS = $(am_libmagic_la_OBJECTS) 12 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) 13 PROGRAMS = $(bin_PROGRAMS) 14 @@ -198,7 +198,7 @@ 15 EXTRA_DIST = test.c 16 AM_CPPFLAGS = -DMAGIC='"$(MAGIC)"' 17 libmagic_la_SOURCES = magic.c apprentice.c softmagic.c ascmagic.c \ 18 - compress.c is_tar.c readelf.c print.c fsmagic.c \ 19 + compress.c is_tar.c readelf.c readfat.c print.c fsmagic.c \ 20 funcs.c file.h names.h patchlevel.h readelf.h tar.h apptype.c 21 22 libmagic_la_LDFLAGS = -no-undefined -version-info 1:0:0 23 @@ -315,6 +315,7 @@ 24 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/magic.Plo@am__quote@ 25 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print.Plo@am__quote@ 26 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readelf.Plo@am__quote@ 27 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readfat.Plo@am__quote@ 28 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/softmagic.Plo@am__quote@ 29 30 .c.o: -
Portfile
18 18 master_sites ftp://ftp.fu-berlin.de/unix/tools/file/ \ 19 19 ftp://ftp.astron.com/pub/file/ \ 20 20 ftp://ftp.gw.com/mirrors/pub/unix/file/ 21 patchfiles patch-4.20-REG_STARTEND 21 22 patchfiles magic__Magdir__macintosh.diff \ 23 magic__Makefile.in.diff_mod \ 24 magic__magic.mime.diff \ 25 src__Makefile.am.diff \ 26 src__Makefile.in.diff_mod \ 27 src__file.h.diff_mod \ 28 src__funcs.c.diff \ 29 src__magic.c.diff \ 30 src__readfat.c.diff 22 31 checksums ${distfiles} \ 23 32 md5 402bdb26356791bd5d277099adacc006 \ 24 33 sha1 af5878e3c61c725a82ff185fcef5b631ad8468ab \ 25 34 rmd160 ff4f1a677a6377df3d7925ab4e36fec71dd3ebe7 \ 26 ${patchfiles}\35 patch-4.20-REG_STARTEND \ 27 36 md5 119b5fd6c60eede06ef909aa13fd65d2 \ 28 37 sha1 4470ba5651e7a41ce8b30114a750a4479b6efe66 \ 29 rmd160 30ca934188bafe6fbe3967c1aee980bd7710b0b1 38 rmd160 30ca934188bafe6fbe3967c1aee980bd7710b0b1 \ 39 magic__Magdir__macintosh.diff \ 40 md5 508b6844947a11aebf59febe9e40b11e \ 41 sha1 084004407cc98028a361f2c2cef9e0403423dbbe \ 42 rmd160 7910e67e72612fded0b667a0b1cda9c5a078e9cb \ 43 magic__magic.mime.diff \ 44 md5 64c6b3caf36cc6a4e12e6dba47e9b06f \ 45 sha1 045bad6ad99a9b190717a90f898c5e91a98d2346 \ 46 rmd160 9b78645e84db770132786820965f4345a37b2bb3 \ 47 src__Makefile.am.diff \ 48 md5 fbd10d36360e13a58968efbe9f7e4365 \ 49 sha1 7c31fb4b5fb2b66cb2eb4b3c93a715c792c5dd5c \ 50 rmd160 21852b22340c4ecf1bff6621bb10bd9773e819b6 \ 51 src__funcs.c.diff \ 52 md5 35e0a0cf29101a709524435b02ae1072 \ 53 sha1 5728fd660f7244c1c32aa503fcdc61af2233246d \ 54 rmd160 7bb1eb825d0205d3d9e56c4b99d72adcdec255d0 \ 55 src__magic.c.diff \ 56 md5 a3e658af1a32f2087e71e57b69835047 \ 57 sha1 82e5cfa7bb68dbfc7b02af335a4cc533dd48a652 \ 58 rmd160 d51fdfe5272cade4958722055d237ce39438af1e \ 59 src__readfat.c.diff \ 60 md5 5c8b6dcc62a7dd57be219d1b3542981e \ 61 sha1 477e0230bdb48040a580d8a0276d30f0faf24128 \ 62 rmd160 bc46d75e30629d211ff2ef0ff0a21905e186bab1 30 63 31 patch_sites ${master_sites} 32 patch.dir ${worksrcpath}/src 64 patch_sites http://www.opensource.apple.com/darwinsource/10.4.8.ppc/file-6/patches 65 pre-patch { 66 system "cd ${worksrcpath}/src && patch -p0 < ${filespath}/patch-4.20-REG_STARTEND" 67 } 33 68 34 69 configure.args --mandir=${prefix}/share/man \ 35 70 --enable-fsect-man5 \