diff options
author | P. J. McDermott <pjm@nac.net> | 2013-09-22 17:13:25 (EDT) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2013-09-22 17:13:25 (EDT) |
commit | da9d788a9059ee88240cbbcc5096abc553b1cf1f (patch) | |
tree | 833ff56ab20f5384091792586d22506dc94bb754 /src | |
parent | 66789c72d83f31b6b6f725d27937967fcce00c32 (diff) | |
download | ssic-da9d788a9059ee88240cbbcc5096abc553b1cf1f.zip ssic-da9d788a9059ee88240cbbcc5096abc553b1cf1f.tar.gz ssic-da9d788a9059ee88240cbbcc5096abc553b1cf1f.tar.bz2 |
Set SCRIPT_FILENAME.
Diffstat (limited to 'src')
-rw-r--r-- | src/ssic.pl | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ssic.pl b/src/ssic.pl index c12ff21..d678556 100644 --- a/src/ssic.pl +++ b/src/ssic.pl @@ -105,6 +105,7 @@ sub compile { my ($input, $output, $vars, $root) = @_; my $input_fh; + my $input_abs; my $output_fh; my $ssi; my $var_name; @@ -116,10 +117,12 @@ sub compile if ($input eq "-") { $input_fh = *STDIN; + $input_abs = File::Spec->rel2abs("."); } else { if (not open($input_fh, "<", $input)) { error(4, "%s: %s\n", $input, $!); } + $input_abs = File::Spec->rel2abs($input); } if ($output eq "-") { $output_fh = *STDOUT; @@ -129,10 +132,12 @@ sub compile } } + # CGI::SSI uses SCRIPT_FILENAME to determine the value of LAST_MODIFIED. %ENV = ( "DOCUMENT_NAME" => $input, "DOCUMENT_URI" => $input, "DOCUMENT_ROOT" => $root, + "SCRIPT_FILENAME" => $input_abs, ); $CGI::SSI::DEBUG = 0; |