openbsd-ports/converters/mpack/patches/patch-unixpk_c
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

25 lines
648 B
Plaintext

$OpenBSD: patch-unixpk_c,v 1.6 2012/12/11 11:01:31 sthen Exp $
--- unixpk.c.orig Mon Jul 21 21:50:41 2003
+++ unixpk.c Tue Dec 11 10:52:18 2012
@@ -25,6 +25,8 @@
#include <stdio.h>
#include <string.h>
#include <errno.h>
+#include <stdlib.h>
+#include <unistd.h>
#include "common.h"
#include "version.h"
#include "xmalloc.h"
@@ -164,9 +166,9 @@ int main(int argc, char **argv)
strcpy(fnamebuf, getenv("TMPDIR"));
}
else {
- strcpy(fnamebuf, "/usr/tmp");
+ strcpy(fnamebuf, "/var/tmp");
}
- strcat(fnamebuf, "/mpackXXXXXX");
+ strcat(fnamebuf, "/mpackXXXXXXXXXX");
mktemp(fnamebuf);
outfname = strsave(fnamebuf);
}