--- loncom/interface/printout.pl 2003/10/20 18:34:20 1.40 +++ loncom/interface/printout.pl 2004/01/08 19:50:47 1.41 @@ -1,7 +1,7 @@ #!/usr/bin/perl # CGI-script to run LaTeX, dvips, ps2ps, ps2pdf etc. # -# $Id: printout.pl,v 1.40 2003/10/20 18:34:20 sakharuk Exp $ +# $Id: printout.pl,v 1.41 2004/01/08 19:50:47 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -70,13 +70,18 @@ END my $noteps; foreach $not_eps (@content_of_file) { if ($not_eps ne '') { + $not_eps=~s|\/\.\/|\/|g; my $eps_f = $not_eps; $eps_f =~ s/\.[^.]*$/\.eps/i; - $_ = $eps_f; - m/\/home\/httpd\/html\/res\/(.+)/; - $eps_f = '/home/httpd/prtspool/'.$1; + if ($eps_f=~/\/home\/([^\/]+)\/public_html\//) { + $eps_f=~s/\/home\/([^\/]+)\/public_html/$1/; + $eps_f = '/home/httpd/prtspool/'.$eps_f; + } else { + $eps_f=~m/\/home\/httpd\/html\/res\/(.+)/; + $eps_f = '/home/httpd/prtspool/'.$1; + } my $path=$eps_f; - $path=~s/\/([^\/]+)\.eps$//; + $path=~s/\/([^\/]+)\.eps$//; File::Path::mkpath($path,0,0777); my $image = Image::Magick->new; $not_eps =~ s/^\s+//;