]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Fix for bug 248988: On Windows, attachments may fail due to "CGI open of tmpfile...
authorjocuri%softhome.net <>
Wed, 7 Jul 2004 15:59:44 +0000 (15:59 +0000)
committerjocuri%softhome.net <>
Wed, 7 Jul 2004 15:59:44 +0000 (15:59 +0000)
CGI.pl

diff --git a/CGI.pl b/CGI.pl
index 6d10268d38791e1d0e88652f7000503661981267..94e727f0896a742c661054e2c65ea0a2c735e9b7 100644 (file)
--- a/CGI.pl
+++ b/CGI.pl
@@ -32,6 +32,14 @@ use lib ".";
 
 # use Carp;                       # for confess
 
+BEGIN {
+    if ($^O =~ /MSWin32/i) {
+        # Help CGI find the correct temp directory as the default list
+        # isn't Windows friendly (Bug 248988)
+        $ENV{'TMPDIR'} = $ENV{'TEMP'} || $ENV{'TMP'} || "$ENV{'WINDIR'}\\TEMP";
+    }
+}
+
 use Bugzilla::Util;
 use Bugzilla::Config;
 use Bugzilla::Constants;