use strict;
+use Cwd;
+
sub new {
my $type = shift;
$form->{tmpfile} =~ s/\Q$userspath\E\///g;
my $latex = $self->_get_latex_path();
+ my $old_home = $ENV{HOME};
+ $ENV{HOME} = $userspath =~ m|^/| ? $userspath : getcwd() . "/" . $userspath;
for (my $run = 1; $run <= 2; $run++) {
system("${latex} --interaction=nonstopmode $form->{tmpfile} " .
"> $form->{tmpfile}.err");
if ($?) {
+ $ENV{HOME} = $old_home;
$self->{"error"} = $form->cleanup();
$self->cleanup();
return 0;
$form->{tmpfile} =~ s/tex$/dvi/;
system("dvips $form->{tmpfile} -o -q > /dev/null");
+ $ENV{HOME} = $old_home;
+
if ($?) {
$self->{"error"} = "dvips : $!";
$self->cleanup();
$form->{tmpfile} =~ s/\Q$userspath\E\///g;
my $latex = $self->_get_latex_path();
+ my $old_home = $ENV{HOME};
+ $ENV{HOME} = $userspath =~ m|^/| ? $userspath : getcwd() . "/" . $userspath;
for (my $run = 1; $run <= 2; $run++) {
system("${latex} --interaction=nonstopmode $form->{tmpfile} " .
"> $form->{tmpfile}.err");
if ($?) {
+ $ENV{HOME} = $old_home;
$self->{"error"} = $form->cleanup();
$self->cleanup();
return 0;
}
}
+ $ENV{HOME} = $old_home;
$form->{tmpfile} =~ s/tex$/pdf/;
$self->cleanup();