Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de writes:
+#ifdef P_tmpdir
- if ( (dir) && lstrcpynA(dirname, P_tmpdir,MAX_PATH)
&& (GetTempFileNameA(dirname,prefix,0,tmpbuf)))
- goto done;
+#endif
- if ( (GetEnvironmentVariableA("PWD",dirname,MAX_PATH) )
&& (GetTempFileNameA(dirname,prefix,0,tmpbuf)))
- goto done;
This won't do what you want, PWD is not updated when the current directory changes, you should use GetCurrentDirectory for that. Also P_tmpdir is a Unix path, it should probably be MSVCRT_P_tmpdir instead (but you'll need to define it in stdio.h first).