changeset 26853:b0f359a5ad35 stable

mkoctfile: use the TMPDIR environment variable if set (bug #55814) * mkoctfile.in.cc (get_temp_directory): Use the standard TMPDIR environment variable when writing temporary files on all systems. Do not use the TMP environment variable on Unixy systems, only on Windows.
author Mike Miller <mtmiller@octave.org>
date Tue, 05 Mar 2019 17:53:30 -0800
parents 4d7665fc8f6c
children a018fca707ca
files src/mkoctfile.in.cc
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/mkoctfile.in.cc	Tue Mar 05 17:29:38 2019 -0800
+++ b/src/mkoctfile.in.cc	Tue Mar 05 17:53:30 2019 -0800
@@ -559,9 +559,12 @@
 {
   std::string tempd;
 
+  tempd = octave_getenv ("TMPDIR");
+
 #if defined (__MINGW32__) || defined (_MSC_VER)
 
-  tempd = octave_getenv ("TEMP");
+  if (tempd.empty ())
+    tempd = octave_getenv ("TEMP");
 
   if (tempd.empty ())
     tempd = octave_getenv ("TMP");
@@ -578,8 +581,6 @@
 
 #else
 
-  tempd = octave_getenv ("TMP");
-
 #if defined (P_tmpdir)
   if (tempd.empty ())
     tempd = P_tmpdir;