OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.26 / (download) - annotate - [select for diffs], Sun Jul 2 10:58:15 2017 UTC (6 years, 10 months ago) by brynet
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, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, HEAD
Changes since 1.25: +11 -10 lines
Diff to previous 1.25 (colored)

Replace fgetln with POSIX getline, even though file was using fgetln in
the idiomatic safe way. Also, check for stream errors with ferror and
err(1, "") in that case.

with feedback from joerg@, schwarze@, nicm@

ok nicm "code is shorter anyway", and joerg@ for an earlier diff

Revision 1.25 / (download) - annotate - [select for diffs], Sat Jul 1 14:34:29 2017 UTC (6 years, 10 months ago) by brynet
Branch: MAIN
Changes since 1.24: +1 -2 lines
Diff to previous 1.24 (colored)

magicfp is fclosed where it was opened, remove fclose from magic_load()

ok nicm deraadt

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

Style nits; no binary change.

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

Exact match use and name with strcmp rather than prefix with strncmp.

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: +42 -4 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 10:34:30 2016 UTC (8 years ago) by nicm
Branch: MAIN
Changes since 1.20: +3 -1 lines
Diff to previous 1.20 (colored)

Trim = prefix from regex (it a noop).

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: +13 -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], Sun Nov 15 22:11:18 2015 UTC (8 years, 6 months ago) by tobias
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.18: +3 -3 lines
Diff to previous 1.18 (colored)

When validating a char by calling strchr() with a string of allowed chars,
check for '\0' first, because strchr() would return non-NULL.

ok nicm

Revision 1.18 / (download) - annotate - [select for diffs], Mon Oct 5 20:05:52 2015 UTC (8 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.17: +60 -3 lines
Diff to previous 1.17 (colored)

Add support for !:strength modifier to adjust strength of a test.

Revision 1.17 / (download) - annotate - [select for diffs], Tue Aug 11 23:17:17 2015 UTC (8 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.16: +3 -5 lines
Diff to previous 1.16 (colored)

Only warn about [bl]estring16 when they are used, like the other
unsupported types.

Revision 1.16 / (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.15: +42 -20 lines
Diff to previous 1.15 (colored)

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

Revision 1.15 / (download) - annotate - [select for diffs], Tue Aug 11 22:35:54 2015 UTC (8 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.14: +10 -2 lines
Diff to previous 1.14 (colored)

Warn sensibly for unrecognised !: lines rather than trying to parse them.

Revision 1.14 / (download) - annotate - [select for diffs], Tue Aug 11 22:27:06 2015 UTC (8 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.13: +1 -3 lines
Diff to previous 1.13 (colored)

Actually leave the invalid ml in the tree after making it type NONE.

Revision 1.13 / (download) - annotate - [select for diffs], Tue Aug 11 22:23:51 2015 UTC (8 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.12: +14 -13 lines
Diff to previous 1.12 (colored)

An invalid line can't just be thrown away because if it has any children
they will end up with the wrong parent. Instead, leave it in the tree
but force its type to NONE so it never matches.

Revision 1.12 / (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.11: +2 -2 lines
Diff to previous 1.11 (colored)

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

Revision 1.11 / (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.10: +28 -13 lines
Diff to previous 1.10 (colored)

Support = test for floats and doubles.

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

If we are expecting a signed number but it fails, try to parse it as
unsigned instead.

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

Allow spaces around any operator, not just =.

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

Include more context in warnings where it is possible.

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

Add another function for printing warnings before the magic_line is
created so all warnings go through the same fprintf.

Revision 1.6 / (download) - annotate - [select for diffs], Wed Jul 8 17:47:15 2015 UTC (8 years, 10 months ago) by tobias
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.5: +3 -3 lines
Diff to previous 1.5 (colored)

Do not allow '\0' as an offset operator or type.

ok nicm

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

I got confused and made the strength multiplier 20, it should be 10.

Revision 1.4 / (download) - annotate - [select for diffs], Sat Apr 25 21:17:09 2015 UTC (9 years ago) by nicm
Branch: MAIN
Changes since 1.3: +9 -5 lines
Diff to previous 1.3 (colored)

Only print MIME warnings when warnings are enabled.

Revision 1.3 / (download) - annotate - [select for diffs], Sat Apr 25 18:44:28 2015 UTC (9 years ago) by nicm
Branch: MAIN
Changes since 1.2: +3 -1 lines
Diff to previous 1.2 (colored)

Fail if a \ appears at EOL rather than continuing off the end of the
buffer, from Sebastien Marie.

Revision 1.2 / (download) - annotate - [select for diffs], Fri Apr 24 16:45:32 2015 UTC (9 years ago) by nicm
Branch: MAIN
Changes since 1.1: +4 -4 lines
Diff to previous 1.1 (colored)

Add a couple of missing spaces (style nits).

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.