Browse Source

try first storing the temporary file in user directory,

only then in current directory
pre-master-46
Holger Vogt 6 years ago
parent
commit
02fdcaff2d
  1. 9
      src/misc/mktemp.c

9
src/misc/mktemp.c

@ -25,6 +25,13 @@ smktemp(char *id)
{
if (!id)
id = "sp";
const char* const home = getenv("HOME");
if (home) {
return tprintf("%s/"TEMPFORMAT, home, id, getpid());
}
const char* const usr = getenv("USERPROFILE");
if (usr) {
return tprintf("%s\\"TEMPFORMAT, usr, id, getpid());
}
return tprintf(TEMPFORMAT, id, getpid());
}
Loading…
Cancel
Save