From ccaf82a249d988a9192034b5afa33b754aefd379 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Fri, 4 Sep 2009 21:08:05 +0000 Subject: Bug 224588: Unify ($^O =~ /MSWin/) checks (always use ON_WINDOWS) Patch by Max Kanat-Alexander r=LpSolit, a=LpSolit --- Bugzilla/CGI.pm | 15 +++++++-------- Bugzilla/Config/Common.pm | 2 +- Bugzilla/Constants.pm | 8 ++++---- 3 files changed, 12 insertions(+), 13 deletions(-) (limited to 'Bugzilla') diff --git a/Bugzilla/CGI.pm b/Bugzilla/CGI.pm index 1a1a1ac74..a00d632c3 100644 --- a/Bugzilla/CGI.pm +++ b/Bugzilla/CGI.pm @@ -21,26 +21,25 @@ # Byron Jones # Marc Schumann +package Bugzilla::CGI; use strict; -package Bugzilla::CGI; +use Bugzilla::Constants; +use Bugzilla::Error; +use Bugzilla::Util; BEGIN { - if ($^O =~ /MSWin32/i) { + if (ON_WINDOWS) { # 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 CGI qw(-no_xhtml -oldstyle_urls :private_tempfiles :unique_headers SERVER_PUSH); - +use CGI qw(-no_xhtml -oldstyle_urls :private_tempfiles + :unique_headers SERVER_PUSH); use base qw(CGI); -use Bugzilla::Constants; -use Bugzilla::Error; -use Bugzilla::Util; - # We need to disable output buffering - see bug 179174 $| = 1; diff --git a/Bugzilla/Config/Common.pm b/Bugzilla/Config/Common.pm index cb95a2f8d..90a5a6c76 100644 --- a/Bugzilla/Config/Common.pm +++ b/Bugzilla/Config/Common.pm @@ -297,7 +297,7 @@ sub check_mail_delivery_method { my $check = check_multi(@_); return $check if $check; my $mailer = shift; - if ($mailer eq 'sendmail' && $^O =~ /MSWin32/i) { + if ($mailer eq 'sendmail' and ON_WINDOWS) { # look for sendmail.exe return "Failed to locate " . SENDMAIL_EXE unless -e SENDMAIL_EXE; diff --git a/Bugzilla/Constants.pm b/Bugzilla/Constants.pm index ef3853788..5691df900 100644 --- a/Bugzilla/Constants.pm +++ b/Bugzilla/Constants.pm @@ -430,13 +430,13 @@ use constant DB_MODULE => { name => 'Oracle'}, }; -# The user who should be considered "root" when we're giving -# instructions to Bugzilla administrators. -use constant ROOT_USER => $^O =~ /MSWin32/i ? 'Administrator' : 'root'; - # True if we're on Win32. use constant ON_WINDOWS => ($^O =~ /MSWin32/i); +# The user who should be considered "root" when we're giving +# instructions to Bugzilla administrators. +use constant ROOT_USER => ON_WINDOWS ? 'Administrator' : 'root'; + use constant MIN_SMALLINT => -32768; use constant MAX_SMALLINT => 32767; -- cgit v1.2.3-24-g4f1b