From 5984a81f34bd8bc8280bb098445368c9557360a9 Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Mon, 29 Oct 2007 00:54:07 +0000 Subject: [PATCH] convert fortran to a soft test (from rrt). --- ChangeLog | 4 ++++ magic/Magdir/fortran | 2 ++ magic/Makefile.am | 1 + magic/magic.mime | 2 ++ src/ascmagic.c | 9 +-------- src/file.c | 3 +-- src/magic.h | 4 +++- src/names.h | 3 +-- 8 files changed, 15 insertions(+), 13 deletions(-) create mode 100644 magic/Magdir/fortran diff --git a/ChangeLog b/ChangeLog index ced051b9..e9f7d985 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-10-28 20:48 Christos Zoulas + + * Convert fortran to a soft test (Reuben Thomas) + 2007-10-23 5:25 Christos Zoulas * Add --with-filename, and --no-filename (Reuben Thomas) diff --git a/magic/Magdir/fortran b/magic/Magdir/fortran new file mode 100644 index 00000000..ce004adb --- /dev/null +++ b/magic/Magdir/fortran @@ -0,0 +1,2 @@ +# FORTRAN source +0 string/c c\ FORTRAN program diff --git a/magic/Makefile.am b/magic/Makefile.am index c7059c56..bc5e002a 100644 --- a/magic/Makefile.am +++ b/magic/Makefile.am @@ -85,6 +85,7 @@ Magdir/fcs \ Magdir/filesystems \ Magdir/flash \ Magdir/fonts \ +Magdir/fortran \ Magdir/frame \ Magdir/freebsd \ Magdir/fsav \ diff --git a/magic/magic.mime b/magic/magic.mime index 9f70fab1..8e558aec 100644 --- a/magic/magic.mime +++ b/magic/magic.mime @@ -960,3 +960,5 @@ # Symbian installation files 8 lelong 0x10000419 application/vnd.symbian.install 0 lelong 0x10201A7A x-epoc/x-sisx-app +# FORTRAN source +0 string/c c\ text/x-fortran diff --git a/src/ascmagic.c b/src/ascmagic.c index b507f775..b1d9d796 100644 --- a/src/ascmagic.c +++ b/src/ascmagic.c @@ -49,7 +49,7 @@ #include "names.h" #ifndef lint -FILE_RCSID("@(#)$File: ascmagic.c,v 1.51 2007/08/19 03:45:07 christos Exp $") +FILE_RCSID("@(#)$File: ascmagic.c,v 1.52 2007/10/17 19:33:31 christos Exp $") #endif /* lint */ typedef unsigned long unichar; @@ -185,13 +185,6 @@ file_ascmagic(struct magic_set *ms, const unsigned char *buf, size_t nbytes) } } - if ((ms->flags & MAGIC_NO_CHECK_FORTRAN) == 0 && - (*buf == 'c' || *buf == 'C') && ISSPC(buf[1])) { - subtype_mime = "text/fortran"; - subtype = "fortran program"; - goto subtype_identified; - } - /* look for tokens from names.h - this is expensive! */ if ((ms->flags & MAGIC_NO_CHECK_TOKENS) != 0) diff --git a/src/file.c b/src/file.c index eb2ad4a2..b4c96dad 100644 --- a/src/file.c +++ b/src/file.c @@ -71,7 +71,7 @@ #include "patchlevel.h" #ifndef lint -FILE_RCSID("@(#)$File: file.c,v 1.114 2007/10/23 21:26:56 christos Exp $") +FILE_RCSID("@(#)$File: file.c,v 1.115 2007/10/25 15:33:17 christos Exp $") #endif /* lint */ @@ -152,7 +152,6 @@ main(int argc, char *argv[]) { "ascii", MAGIC_NO_CHECK_ASCII }, { "compress", MAGIC_NO_CHECK_COMPRESS }, { "elf", MAGIC_NO_CHECK_ELF }, - { "fortran", MAGIC_NO_CHECK_FORTRAN }, { "soft", MAGIC_NO_CHECK_SOFT }, { "tar", MAGIC_NO_CHECK_TAR }, { "tokens", MAGIC_NO_CHECK_TOKENS }, diff --git a/src/magic.h b/src/magic.h index 96aa2f68..6041f548 100644 --- a/src/magic.h +++ b/src/magic.h @@ -49,9 +49,11 @@ #define MAGIC_NO_CHECK_ELF 0x010000 /* Don't check for elf details */ #define MAGIC_NO_CHECK_ASCII 0x020000 /* Don't check for ascii files */ #define MAGIC_NO_CHECK_TROFF 0x040000 /* Don't check ascii/troff */ -#define MAGIC_NO_CHECK_FORTRAN 0x080000 /* Don't check ascii/fortran */ #define MAGIC_NO_CHECK_TOKENS 0x100000 /* Don't check ascii/tokens */ +/* Defined for backwards compatibility; does nothing */ +#define MAGIC_NO_CHECK_FORTRAN 0x000000 /* Don't check ascii/fortran */ + #ifdef __cplusplus extern "C" { #endif diff --git a/src/names.h b/src/names.h index d4c3590c..3ee1a861 100644 --- a/src/names.h +++ b/src/names.h @@ -32,7 +32,7 @@ * appear at fixed offsets into the file. Don't make HOWMANY * too high unless you have a very fast CPU. * - * $File: names.h,v 1.26 2007/01/12 17:38:28 christos Exp $ + * $File: names.h,v 1.27 2007/05/08 16:47:03 christos Exp $ */ /* @@ -63,7 +63,6 @@ static const struct { } types[] = { { "C program", "text/x-c", }, { "C++ program", "text/x-c++" }, - { "FORTRAN program", "text/x-fortran" }, { "make commands", "text/x-makefile" }, { "PL/1 program", "text/x-pl1" }, { "assembler program", "text/x-asm" }, -- 2.40.0