OpenBSD CVS

CVS log for src/usr.bin/file/magic-test.c


[BACK] Up to [local] / src / usr.bin / file

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.27 / (download) - annotate - [select for diffs], Tue Jan 15 09:24:59 2019 UTC (5 years, 4 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, HEAD
Changes since 1.26: +2 -2 lines
Diff to previous 1.26 (colored)

Regex flags should include REG_NEWLINE and REG_ICASE should actually be
used if specified.

Revision 1.26 / (download) - annotate - [select for diffs], Thu Jun 14 19:51:11 2018 UTC (5 years, 11 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.25: +3 -3 lines
Diff to previous 1.25 (colored)

Return from magic_test does not need to be copied because the caller
will do so anyway and it was just being leaked. ok brynet deraadt

Revision 1.25 / (download) - annotate - [select for diffs], Tue Apr 18 14:16:48 2017 UTC (7 years, 1 month ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored)

Style nits; no binary change.

Revision 1.24 / (download) - annotate - [select for diffs], Fri Aug 26 08:50:31 2016 UTC (7 years, 8 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.23: +2 -1 lines
Diff to previous 1.23 (colored)

Pull in <time.h> for ctime_r, gmtime, etc

ok deraadt@

Revision 1.23 / (download) - annotate - [select for diffs], Sun May 1 11:26:19 2016 UTC (8 years ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.22: +2 -2 lines
Diff to previous 1.22 (colored)

Use the right size (include the length byte) when working out if a
pstring is too big.

Revision 1.22 / (download) - annotate - [select for diffs], Sun May 1 10:56:03 2016 UTC (8 years ago) by nicm
Branch: MAIN
Changes since 1.21: +173 -35 lines
Diff to previous 1.21 (colored)

Add support for 'name' and 'use' which allows more of the latest magic
files to work unchanged. (We are still missing 'indirect' and a few
other bits.)

Revision 1.21 / (download) - annotate - [select for diffs], Sun May 1 08:53:26 2016 UTC (8 years ago) by nicm
Branch: MAIN
Changes since 1.20: +3 -4 lines
Diff to previous 1.20 (colored)

Remove __unused that are now lies.

Revision 1.20 / (download) - annotate - [select for diffs], Sun May 1 08:48:39 2016 UTC (8 years ago) by nicm
Branch: MAIN
Changes since 1.19: +17 -2 lines
Diff to previous 1.19 (colored)

Add support for 'clear' test, and fix 'default' to expand the result
string if any (used by, for example, rtf).

Revision 1.19 / (download) - annotate - [select for diffs], Sat Apr 30 22:03:30 2016 UTC (8 years ago) by nicm
Branch: MAIN
Changes since 1.18: +2 -3 lines
Diff to previous 1.18 (colored)

magic_test_type_default parameter is no longer __unused.

Revision 1.18 / (download) - annotate - [select for diffs], Sat Apr 30 21:42:11 2016 UTC (8 years ago) by nicm
Branch: MAIN
Changes since 1.17: +5 -2 lines
Diff to previous 1.17 (colored)

Fix the default type to work properly, that is to only match if no
previous test at the same level has matched.

Revision 1.17 / (download) - annotate - [select for diffs], Sat Apr 30 21:10:28 2016 UTC (8 years ago) by nicm
Branch: MAIN
Changes since 1.16: +5 -3 lines
Diff to previous 1.16 (colored)

Replace regex match string in results (some new magic entries use this).

Revision 1.16 / (download) - annotate - [select for diffs], Sat Feb 20 15:29:37 2016 UTC (8 years, 2 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.15: +2 -2 lines
Diff to previous 1.15 (colored)

Fix the C type used for 32-bit float/lefloat/befloat, it should be float
not double (they are not used in any magic files anyway at the moment
though). Spotted by and ok jsg.

Revision 1.15 / (download) - annotate - [select for diffs], Tue Oct 6 08:20:10 2015 UTC (8 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (colored)

Log the matched offset (and the new offset) instead of just of the new
offset (as if it was where the match was found).

Revision 1.14 / (download) - annotate - [select for diffs], Mon Oct 5 19:50:38 2015 UTC (8 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.13: +5 -5 lines
Diff to previous 1.13 (colored)

Offset into the file can be size_t and add some casts to remove warnings.

Revision 1.13 / (download) - annotate - [select for diffs], Wed Aug 12 09:39:43 2015 UTC (8 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.12: +17 -1 lines
Diff to previous 1.12 (colored)

Support + and - for dates.

Revision 1.12 / (download) - annotate - [select for diffs], Wed Aug 12 09:29:49 2015 UTC (8 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.11: +10 -7 lines
Diff to previous 1.11 (colored)

Fix adjustment of the offset when string, pstring or search match.

Revision 1.11 / (download) - annotate - [select for diffs], Wed Aug 12 07:43:27 2015 UTC (8 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.10: +9 -1 lines
Diff to previous 1.10 (colored)

Add string/Ww as aliases for string/Bb, and ignore t. (The latest
version of the original file replaced Bb with Ww and then reused b for
something else (!), but alias them instead.)

Revision 1.10 / (download) - annotate - [select for diffs], Tue Aug 11 23:03:26 2015 UTC (8 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.9: +2 -1 lines
Diff to previous 1.9 (colored)

When an exact string match is found, only print the test string, not up
to \0. Noticed by Theo with some GIF files.

Revision 1.9 / (download) - annotate - [select for diffs], Tue Aug 11 22:48:09 2015 UTC (8 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.8: +15 -2 lines
Diff to previous 1.8 (colored)

Any type can be prefixed with "u", even where it makes no sense. Also
make pstring/upstring a text type.

Revision 1.8 / (download) - annotate - [select for diffs], Tue Aug 11 22:18:43 2015 UTC (8 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.7: +81 -1 lines
Diff to previous 1.7 (colored)

Extend accepted operators to +-&/%* for integer tests.

Revision 1.7 / (download) - annotate - [select for diffs], Tue Aug 11 22:12:48 2015 UTC (8 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.6: +25 -11 lines
Diff to previous 1.6 (colored)

Support = test for floats and doubles.

Revision 1.6 / (download) - annotate - [select for diffs], Fri May 29 15:58:01 2015 UTC (8 years, 11 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.5: +3 -3 lines
Diff to previous 1.5 (colored)

Use gmtime not localtime when we want UTC, I got it right in one place
but not in another two. I expect I was confused by the fact that the
original file(1) had them the wrong way round (so, for example, leqldate
was actually UTC).

Revision 1.5 / (download) - annotate - [select for diffs], Fri May 29 15:11:08 2015 UTC (8 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.4: +2 -2 lines
Diff to previous 1.4 (colored)

Don't stop at the first successful test unless it has generated some
output.

Revision 1.4 / (download) - annotate - [select for diffs], Fri May 29 14:52:10 2015 UTC (8 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 (colored)

The case-insensitive flag (c) for string and search tests doesn't make
the entire match case sensitive, only lower case characters.

Revision 1.3 / (download) - annotate - [select for diffs], Sat Apr 25 16:35:47 2015 UTC (9 years ago) by brynet
Branch: MAIN
Changes since 1.2: +29 -29 lines
Diff to previous 1.2 (colored)

Switch to using the POSIX endian macros, i.e: be64toh vs. betoh64.

ok nicm@

Revision 1.2 / (download) - annotate - [select for diffs], Fri Apr 24 17:19:06 2015 UTC (9 years ago) by deraadt
Branch: MAIN
Changes since 1.1: +2 -2 lines
Diff to previous 1.1 (colored)

move an ugly space

Revision 1.1 / (download) - annotate - [select for diffs], Fri Apr 24 16:24:11 2015 UTC (9 years ago) by nicm
Branch: MAIN

New implementation of the file(1) utility. This is a simplified,
modernised version with a nearly complete magic(5) parser but omits some
of the complex builtin tests (notably ELF) and has a reduced set of
options.

ok deraadt

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.