sthen 41ed53ba17 - fix unpacking of multiple parts (from Gentoo, possibly via FreeBSD).
- recognise PNG files and set appropriate mime type (from FreeBSD).

- remove botched mkstemp() conversion which broke mpack(1);
a proper mkstemp conversion is intrusive.

- use some additional XXXX in the temporary filename.

- let this build with CLang scan-build.
2012-12-11 11:01:31 +00:00

20 lines
574 B
Plaintext

$OpenBSD: patch-magic_c,v 1.2 2012/12/11 11:01:31 sthen Exp $
--- magic.c.orig Mon Jul 21 21:35:31 2003
+++ magic.c Tue Dec 11 10:10:23 2012
@@ -23,6 +23,7 @@
* SOFTWARE.
*/
#include <stdio.h>
+#include <string.h>
/* Description of the various file formats and their magic numbers */
struct magic {
@@ -35,6 +36,7 @@ struct magic {
static struct magic magic[] = {
{ "image/gif", "GIF", 0 },
{ "image/jpeg", "\377\330\377", 0 },
+ { "image/png", "\211PNG", 0 },
{ "video/mpeg", "\0\0\001\263", 4 },
{ "application/postscript", "%!", 0 },
};