X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=src%2Fssic.pl;fp=src%2Fssic.pl;h=d678556be7716789249ad70d4c540e31f266ad71;hb=da9d788a9059ee88240cbbcc5096abc553b1cf1f;hp=c12ff210b4046ae9cc72645def51ac4d1076f093;hpb=66789c72d83f31b6b6f725d27937967fcce00c32;p=ssic.git 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;