summaryrefslogtreecommitdiff
path: root/mwc.pl
diff options
context:
space:
mode:
authorelliott_c <ocielliottc@users.noreply.github.com>2010-03-15 12:54:41 +0000
committerelliott_c <ocielliottc@users.noreply.github.com>2010-03-15 12:54:41 +0000
commit803f4983d456988e2af5ab263b71837a4419fa81 (patch)
tree35ced31712acac8c5bee2688b49b9a248c2d3916 /mwc.pl
parenta9b495bb4d1c5d04f18b53b1e51eb51ff62d93a2 (diff)
downloadMPC-803f4983d456988e2af5ab263b71837a4419fa81.tar.gz
ChangeLogTag: Mon Mar 15 12:53:26 UTC 2010 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'mwc.pl')
-rwxr-xr-xmwc.pl13
1 files changed, 7 insertions, 6 deletions
diff --git a/mwc.pl b/mwc.pl
index 3697ddb3..f2d9187e 100755
--- a/mwc.pl
+++ b/mwc.pl
@@ -20,12 +20,13 @@ use FindBin;
use File::Spec;
use File::Basename;
-my $basePath = $FindBin::RealBin;
-my $baseName = $FindBin::RealScript;
-if ($^O eq 'VMS') {
- $basePath = File::Spec->rel2abs(dirname($0)) if ($basePath eq '');
- $basePath = VMS::Filespec::unixify($basePath);
-}
+## Sometimes $FindBin::RealBin will end up undefined. If it is, we need
+## to use the directory of the built-in script name. And, for VMS, we
+## have to convert that into a UNIX path so that Perl can use it
+## internally.
+my $basePath = (defined $FindBin::RealBin && $FindBin::RealBin ne '' ?
+ $FindBin::RealBin : File::Spec->rel2abs(dirname($0)));
+$basePath = VMS::Filespec::unixify($basePath) if ($^O eq 'VMS');
unshift(@INC, $basePath . '/modules');
require Driver;