forked from Lainports/freebsd-ports
- Clean up patches due to upstream whitespace cleanup/changes - Mark NNTP patch broken with 1.12.0 - VVV quote patch broken. Add to files/ fixed version until updated upstream - Update extra-patch-maildir-mtime* due to upstream 6317a30369e - Remove extra-patch-smime-outlook. The code [2] backing this patch was removed [*] http://www.mutt.org/relnotes/1.12/ PR: 238179 Submitted by: Derek Schrock <dereks@lifeofadishwasher.com> (maintainer)
25 lines
1.3 KiB
C
25 lines
1.3 KiB
C
--- muttlib.c.orig 2019-05-26 19:28:53 UTC
|
|
+++ muttlib.c
|
|
@@ -856,16 +856,15 @@ void _mutt_buffer_mktemp (BUFFER *buf, const char *pre
|
|
void _mutt_mktemp (char *s, size_t slen, const char *prefix, const char *suffix,
|
|
const char *src, int line)
|
|
{
|
|
- size_t n = snprintf (s, slen, "%s/%s-%s-%d-%d-%ld%ld%s%s",
|
|
- NONULL (Tempdir), NONULL (prefix), NONULL (Hostname),
|
|
- (int) getuid (), (int) getpid (), random (), random (),
|
|
- suffix ? "." : "", NONULL (suffix));
|
|
+ size_t n = snprintf (s, slen, "%s/mutt-%s-XXXXXXXX", NONULL (Tempdir), NONULL (Hostname));
|
|
if (n >= slen)
|
|
dprint (1, (debugfile, "%s:%d: ERROR: insufficient buffer space to hold temporary filename! slen=%zu but need %zu\n",
|
|
src, line, slen, n));
|
|
- dprint (3, (debugfile, "%s:%d: mutt_mktemp returns \"%s\".\n", src, line, s));
|
|
- if (unlink (s) && errno != ENOENT)
|
|
- dprint (1, (debugfile, "%s:%d: ERROR: unlink(\"%s\"): %s (errno %d)\n", src, line, s, strerror (errno), errno));
|
|
+ if (mktemp (s)) {
|
|
+ dprint (3, (debugfile, "%s:%d: mutt_mktemp returns \"%s\".\n", src, line, s));
|
|
+ } else {
|
|
+ dprint (1, (debugfile, "%s:%d: ERROR: mktemp(\"%s\"): %s (errno %d)\n", src, line, s, strerror (errno), errno));
|
|
+ }
|
|
}
|
|
|
|
/* these characters must be escaped in regular expressions */
|