diff options
author | Steve Huston <shuston@riverace.com> | 2002-12-18 18:38:24 +0000 |
---|---|---|
committer | Steve Huston <shuston@riverace.com> | 2002-12-18 18:38:24 +0000 |
commit | 8a44795cb7ffb9c0940e1cddcd3f7594603d6f57 (patch) | |
tree | 47f1e239a1f4b7f264f9da1c709eeff516374707 | |
parent | 60d470f5771f16defa1b56c5a6b06a9775dd31a2 (diff) | |
download | MPC-8a44795cb7ffb9c0940e1cddcd3f7594603d6f57.tar.gz |
ChangeLogTag:Wed Dec 18 13:36:49 2002 Steve Huston <shuston@riverace.com>
-rw-r--r-- | modules/Driver.pm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/Driver.pm b/modules/Driver.pm index 25336693..296bdc86 100644 --- a/modules/Driver.pm +++ b/modules/Driver.pm @@ -11,6 +11,7 @@ package Driver; # ************************************************************ use strict; +use File::Basename; # ************************************************************ # Data Section @@ -345,6 +346,15 @@ sub run { my(%loaded) = (); ## Generate the files foreach my $file (@input) { + ## To correctly reference any pathnames in the input file, chdir to + ## its directory if there's any directory component to the specified path. + my $orig_dir = Cwd::getcwd(); + my $dir = dirname($file); + my $base = basename($file); + if ($base ne $file) { + chdir($dir); + $file = $base; + } foreach my $name (@generators) { if (!$loaded{$name}) { require "$name.pm"; @@ -363,6 +373,7 @@ sub run { } print " End Time: " . scalar(localtime(time())) . "\n"; } + chdir($orig_dir); } return $status; |