[LON-CAPA-cvs] cvs: loncom /interface printout.pl

foxr lon-capa-cvs@mail.lon-capa.org
Tue, 15 Mar 2005 11:19:28 -0000


foxr		Tue Mar 15 06:19:28 2005 EDT

  Modified files:              
    /loncom/interface	printout.pl 
  Log:
  Defect 3058: modify destination path of image conversions so that spaces get
              >replaced< with _ since spaces in paths drives system and
              LaTeX nuts.
  
  
Index: loncom/interface/printout.pl
diff -u loncom/interface/printout.pl:1.73 loncom/interface/printout.pl:1.74
--- loncom/interface/printout.pl:1.73	Mon Mar 14 18:51:20 2005
+++ loncom/interface/printout.pl	Tue Mar 15 06:19:28 2005
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 # CGI-script to run LaTeX, dvips, ps2ps, ps2pdf etc.
 #
-# $Id: printout.pl,v 1.73 2005/03/14 23:51:20 foxr Exp $
+# $Id: printout.pl,v 1.74 2005/03/15 11:19:28 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -114,12 +114,14 @@
 		  $eps_f=~/$Apache::lonnet::perlvar{'lonUsersDir'}\/([^\/]+)\/\w\/\w\/\w\/(.+)/;
 		  $eps_f = '/home/httpd/prtspool/'.$1.'/'.$2;
 	      }
+	      $eps_f  =~ s/ /\_/g; # Spaces are problematic for system commands and LaTeX.
 	      my $path=$eps_f;
-	      $path=~s/\/([^\/]+)\.eps$//;
+	      $path =~ s/\/([^\/]+)\.eps$//;
 	      # print "Final file path: $path "; # Debugging
 	      File::Path::mkpath($path,0,0777);
 	      $not_eps =~ s/^\s+//;
 	      $not_eps =~ s/\s+$//;
+	      $not_eps =~ s/ /\\ /g;
 	      if ( exists($done_conversion{$not_eps})) { next; }
 	      if ($adv) {
 		  my $prettyname=$not_eps;
@@ -141,7 +143,9 @@
 	      }  
 	  }
       }
-      if ($adv) { &Apache::lonhtmlcommon::Close_PrgWin('',\%prog_state); }
+      if ($adv) { 
+	  &Apache::lonhtmlcommon::Close_PrgWin('',\%prog_state); 
+      }
       unlink($figfile);
   }
   #print "$texfile\n"; #name of the tex file for debugging only