aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-01-09 08:32:59 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-01-09 08:32:59 +0000
commitf55b54917a3452eda8cc8f4f63889f6cf22d64e5 (patch)
tree6bf43f3927e47cd0417e5cc5551b2100e5cc9cd8 /src
parent46580147a5e4590e87bfe5e9b0f4c3ff50e59821 (diff)
downloadpandoc-f55b54917a3452eda8cc8f4f63889f6cf22d64e5.tar.gz
On Cygwin, set TMPDIR to . before using mktemp. Otherwise
one gets an error creating the output file in the /tmp directory. I haven't tracked this one down, but this should serve as a workaround. git-svn-id: https://pandoc.googlecode.com/svn/trunk@481 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src')
-rw-r--r--src/wrappers/tempdir.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/wrappers/tempdir.sh b/src/wrappers/tempdir.sh
index 8d2754b1c..4426b73a7 100644
--- a/src/wrappers/tempdir.sh
+++ b/src/wrappers/tempdir.sh
@@ -1,6 +1,13 @@
# As a security measure refuse to proceed if mktemp is not available.
pathfind mktemp || { err "Couldn't find 'mktemp'; aborting."; exit 1; }
+# Avoid issues with /tmp directory on Windows/Cygwin
+cygwin=
+cygwin=$(uname | sed -ne '/^CYGWIN/p')
+if [ -n "$cygwin" ]; then
+ TMPDIR=.
+fi
+
THIS_TEMPDIR=
THIS_TEMPDIR="$(mktemp -d -t $THIS.XXXXXXXX)" || exit 1
readonly THIS_TEMPDIR