projects
/
ssic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allow input and output to both be "-".
[ssic.git]
/
src
/
ssic.pl
diff --git
a/src/ssic.pl
b/src/ssic.pl
index c12ff210b4046ae9cc72645def51ac4d1076f093..8ecc30e92104be274b2178284bcb3cb6bc9f9c45 100644
(file)
--- a/
src/ssic.pl
+++ b/
src/ssic.pl
@@
-105,21
+105,24
@@
sub compile
{
my ($input, $output, $vars, $root) = @_;
my $input_fh;
{
my ($input, $output, $vars, $root) = @_;
my $input_fh;
+ my $input_abs;
my $output_fh;
my $ssi;
my $var_name;
my $var_value;
my $output_fh;
my $ssi;
my $var_name;
my $var_value;
- if ($input eq $output) {
+ if ($input eq $output
and $input ne "-"
) {
error(4, "Input and output files are equal\n");
}
if ($input eq "-") {
$input_fh = *STDIN;
error(4, "Input and output files are equal\n");
}
if ($input eq "-") {
$input_fh = *STDIN;
+ $input_abs = File::Spec->rel2abs(".");
} else {
if (not open($input_fh, "<", $input)) {
error(4, "%s: %s\n", $input, $!);
}
} 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;
}
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,
%ENV = (
"DOCUMENT_NAME" => $input,
"DOCUMENT_URI" => $input,
"DOCUMENT_ROOT" => $root,
+ "SCRIPT_FILENAME" => $input_abs,
);
$CGI::SSI::DEBUG = 0;
);
$CGI::SSI::DEBUG = 0;