From 8a824fbe52d995a911019839c0a8dfa951141aea Mon Sep 17 00:00:00 2001 From: Robert Pengelly Date: Mon, 13 Oct 2025 04:32:04 +0100 Subject: [PATCH] Try getting TMPDIR first --- lib.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib.c b/lib.c index fa03cc4..af41105 100644 --- a/lib.c +++ b/lib.c @@ -273,9 +273,13 @@ void *xrealloc (void *__ptr, unsigned long __size) { #if defined (unix) || defined (__unix) || defined (__unix__) || defined (__APPLE__) FILE *get_temp_file (void) { - char *temp_path = "/tmp", *template; + char *temp_path, *template; int fd; + if (!(temp_path = getenv ("TMPDIR"))) { + temp_path = "/tmp"; + } + template = xmalloc (strlen (temp_path) + 1 + 10 + 1); sprintf (template, "%s/sarXXXXXX", temp_path); -- 2.34.1