[PATCH v2 1/3] Remove unused non-buffer tempdir functions.

"Kevin J. McCarthy" <[email protected]>
Newsgroups gmane.mail.mutt.devel
Message-ID <[email protected]>
These were converted to buffer versions a while ago, but I left the
old ones around in case of external patches.

Remove them before the introduction of a seperate $tmpdraftdir
directory for composing emails in the next few commits.
---
 muttlib.c | 19 -------------------
 protos.h  |  3 ---
 2 files changed, 22 deletions(-)

diff --git a/muttlib.c b/muttlib.c
index 4c20e8c5..8c5b94a3 100644
--- a/muttlib.c
+++ b/muttlib.c
@@ -974,25 +974,6 @@ void _mutt_buffer_mktemp (BUFFER *buf, const char *prefix, const char *suffix,
     mutt_errno_dbg(1, "%s:%d: ERROR: unlink(\"%s\")", src, line, mutt_b2s (buf));
 }
 
-void _mutt_mktemp (char *s, size_t slen, const char *prefix, const char *suffix,
-                   const char *src, int line)
-{
-  RANDOM64 random64;
-  mutt_random_bytes(random64.char_array, sizeof(random64));
-
-  size_t n = snprintf (s, slen, "%s/%s-%s-%d-%d-%"PRIu64"%s%s",
-                       NONULL (Tempdir), NONULL (prefix), NONULL (Hostname),
-                       (int) getuid (), (int) getpid (), random64.int_64,
-                       suffix ? "." : "", NONULL (suffix));
-  if (n >= slen)
-    muttdbg(1, "%s:%d: ERROR: insufficient buffer space "
-               "to hold temporary filename! slen=%zu but need %zu",
-               src, line, slen, n);
-  muttdbg(3, "%s:%d: mutt_mktemp returns \"%s\".", src, line, s);
-  if (unlink (s) && errno != ENOENT)
-    mutt_errno_dbg(1, "%s:%d: ERROR: unlink(\"%s\")", src, line, s);
-}
-
 /* these characters must be escaped in regular expressions */
 
 static const char rx_special_chars[] = "^.[$()|*+?{\\";
diff --git a/protos.h b/protos.h
index 26da1cc2..10689e7a 100644
--- a/protos.h
+++ b/protos.h
@@ -249,9 +249,6 @@ void mutt_message_to_7bit (BODY *, FILE *);
 #define mutt_buffer_mktemp(a) mutt_buffer_mktemp_pfx_sfx (a, "mutt", NULL)
 #define mutt_buffer_mktemp_pfx_sfx(a,b,c)  _mutt_buffer_mktemp (a, b, c, __FILE__, __LINE__)
 void _mutt_buffer_mktemp (BUFFER *, const char *, const char *, const char *, int);
-#define mutt_mktemp(a,b) mutt_mktemp_pfx_sfx (a, b, "mutt", NULL)
-#define mutt_mktemp_pfx_sfx(a,b,c,d)  _mutt_mktemp (a, b, c, d, __FILE__, __LINE__)
-void _mutt_mktemp (char *, size_t, const char *, const char *, const char *, int);
 void mutt_normalize_time (struct tm *);
 void mutt_paddstr (int, const char *);
 void mutt_parse_mime_message (CONTEXT *ctx, HEADER *);
-- 
2.53.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.