Description: TMPDIR honouring
Origin: debian
Author: Jerome Benoit <calculus@rezozer.net>
Last-Update: 2013-12-30

Index: gap-4r7p5/src/sysfiles.c
===================================================================
--- gap-4r7p5.orig/src/sysfiles.c	2014-05-24 21:02:58.000000000 +0200
+++ gap-4r7p5/src/sysfiles.c	2014-05-31 19:07:12.370662605 +0200
@@ -3728,7 +3728,13 @@
 {
   static char name[1024];
   static const char *base = TMPDIR_BASE;
-  strxcpy(name, base, sizeof(name));
+  char * env_tmpdir;
+  if ((env_tmpdir = getenv("TMPDIR")) != NULL) {
+    strxcpy(name, env_tmpdir, sizeof(name));
+    strxcat(name, "/", sizeof(name));
+  }
+  else
+    strxcpy(name, base, sizeof(name));
   if (hint)
     strxcat(name, hint, sizeof(name));
   else
