aboutsummaryrefslogtreecommitdiff
path: root/readline/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'readline/util.c')
-rw-r--r--readline/util.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/readline/util.c b/readline/util.c
index 321dee2..d402fce 100644
--- a/readline/util.c
+++ b/readline/util.c
@@ -55,6 +55,7 @@
#include "rlprivate.h"
#include "xmalloc.h"
+#include "rlshell.h"
/* **************************************************************** */
/* */
@@ -507,7 +508,17 @@ _rl_tropen ()
if (_rl_tracefp)
fclose (_rl_tracefp);
+#if defined (_WIN32) && !defined (__CYGWIN__)
+ /* Windows doesn't have /var/tmp, so open the trace file in the
+ user's temporary directory instead. */
+ sprintf (fnbuf, "%s/rltrace.%ld",
+ (sh_get_env_value ("TEMP")
+ ? sh_get_env_value ("TEMP")
+ : "."),
+ getpid());
+#else
sprintf (fnbuf, "/var/tmp/rltrace.%ld", getpid());
+#endif
unlink(fnbuf);
_rl_tracefp = fopen (fnbuf, "w+");
return _rl_tracefp != 0;