Index: Tst/regress.cmd
===================================================================
--- Tst/regress.cmd	(revision 3735d1567b97cc35de0aeae181e4401fcb3a6178)
+++ Tst/regress.cmd	(revision f5128b81db6234a95c758976b4968520e513441e)
@@ -2,5 +2,5 @@
 
 #################################################################
-# $Id: regress.cmd,v 1.39 2004-02-12 13:00:24 Singular Exp $
+# $Id: regress.cmd,v 1.40 2009-02-12 15:42:38 motsak Exp $
 # FILE:    regress.cmd
 # PURPOSE: Script which runs regress test of Singular
@@ -192,12 +192,12 @@
 
   # prepare the result files:
-  &mysystem("$cat $root.res | $tr -d '\\013' | $sed $sed_scripts > $root.res.cleaned");
-  &mysystem("$cat $root.new.res | $tr -d '\\013' | $sed $sed_scripts > $root.new.res.cleaned");
+  &mysystem("$cat \"$root.res\" | $tr -d '\\013' | $sed $sed_scripts > \"$root.res.cleaned\"");
+  &mysystem("$cat \"$root.new.res\" | $tr -d '\\013' | $sed $sed_scripts > \"$root.new.res.cleaned\"");
 
   # doo the diff call
-  $exit_status = &mysystem("$diff -w -b $root.res.cleaned $root.new.res.cleaned > $root.diff 2>&1");
+  $exit_status = &mysystem("$diff -w -b \"$root.res.cleaned\" \"$root.new.res.cleaned\" > \"$root.diff\" 2>&1");
 
   # clean up time
-  &mysystem("$rm -f $root.res.cleaned $root.new.res.cleaned");
+  &mysystem("$rm -f \"$root.res.cleaned\" \"$root.new.res.cleaned\"");
 
   # there seems to be a bug here somewhere: even if diff reported
@@ -334,5 +334,5 @@
       close(NEW_RES_FILE);
       close(TEMP_FILE);
-      &mysystem("$rm $root.tmp.stat");
+      &mysystem("$rm \"$root.tmp.stat\"");
       return (1, "Can not find '$prefix >> $crit' in $root.stat\n");
     }
@@ -354,6 +354,6 @@
   close(NEW_RES_FILE);
   close(TEMP_FILE);
-  &mysystem("$mv -f $root.tmp.stat $root.stat");
-  &mysystem("$rm -f $root.new.stat $root.stat.sdiff") unless $keep eq "yes";
+  &mysystem("$mv -f \"$root.tmp.stat\" \"$root.stat\"");
+  &mysystem("$rm -f \"$root.new.stat\" \"$root.stat.sdiff\"") unless $keep eq "yes";
   return ;
 }
@@ -386,5 +386,5 @@
     if ((-r "$root.res.gz.uu") && ! ( -z "$root.res.gz.uu"))
     {
-      $exit_status = &mysystem("$uudecode $root.res.gz.uu > /dev/null 2>&1; $gunzip -f $root.res.gz");
+      $exit_status = &mysystem("$uudecode \"$root.res.gz.uu\" > /dev/null 2>&1; $gunzip -f \"$root.res.gz\"");
       if ($exit_status)
       {
@@ -400,13 +400,13 @@
   }
 
-  my $resfile = "$root.new.res";
-  $resfile = "$root.mtrack.res" if (defined($mtrack));
+  my $resfile = "\"$root.new.res\"";
+  $resfile = "\"$root.mtrack.res\"" if (defined($mtrack));
   my $statfile = "$root.new.stat";
-  &mysystem("$rm -f $statfile");
+  &mysystem("$rm -f \"$statfile\"");
   if (defined($mtrack))
   {
-    $system_call = "$cat $root.tst | sed -e 's/\\\\\$/LIB \"general.lib\"; killall(); killall(\"proc\");kill killall;system(\"mtrack\", \"$root.mtrack.unused\", $mtrack); \\\$/' | $singular $singularOptions ";
+    $system_call = "$cat \"$root.tst\" | sed -e 's/\\\\\$/LIB \"general.lib\"; killall(); killall(\"proc\");kill killall;system(\"mtrack\", \"$root.mtrack.unused\", $mtrack); \\\$/' | $singular $singularOptions ";
     $system_call .= ($verbosity > 3 ? " | $tee " : " > ");
-    $system_call .= "$root.mtrack.res";
+    $system_call .= "\"$root.mtrack.res\"";
     $system_call .= " 2>&1 " if ($verbosity <= 3);
   }
@@ -417,9 +417,9 @@
     if ($verbosity > 3 && !$WINNT)
     {
-      $system_call = "$cat $root.tst | $singular --execute 'string tst_status_file=\"$statfile\";' $singularOptions | $tee $resfile";
+      $system_call = "$cat \"$root.tst\" | $singular --execute 'string tst_status_file=\"$statfile\";' $singularOptions | $tee $resfile";
     }
     else
     {
-      $system_call = "$cat $root.tst | $singular --execute 'string tst_status_file=\"$statfile\";' $singularOptions > $resfile 2>&1";
+      $system_call = "$cat \"$root.tst\" | $singular --execute 'string tst_status_file=\"$statfile\";' $singularOptions > $resfile 2>&1";
     }
   }
@@ -446,8 +446,8 @@
     elsif (! defined($mtrack) && !defined($timings_only))
     {
-      &mysystem("$rm -f $root.diff");
+      &mysystem("$rm -f \"$root.diff\"");
       if ($generate eq "yes")
       {
-        &mysystem("$cp $resfile $root.res");
+        &mysystem("$cp $resfile \"$root.res\"");
       }
       else
@@ -460,5 +460,5 @@
 	  {
 	    print "\n";
-	    mysystem("$cat $root.diff");
+	    mysystem("$cat \"$root.diff\"");
 	  }
           $error_cause = "Differences in res files";
@@ -466,5 +466,5 @@
         else
         {
-          &mysystem("$rm -f $root.diff");
+          &mysystem("$rm -f \"$root.diff\"");
         }
       }
@@ -472,5 +472,7 @@
   }
 
-  mysystem("mv tst_status.out $statfile")
+
+
+  mysystem("mv tst_status.out \"$statfile\"")
     if (! -e $statfile && -e "tst_status.out");
 
@@ -507,9 +509,9 @@
       if ($generate eq "yes")
       {
-	mysystem("$rm -f $root.stat") unless %merge;
+	mysystem("$rm -f \"$root.stat\"") unless %merge;
 	($exit_status, $error_cause) = tst_status_merge($root);
 	if (! $WINNT)
 	{
-	  &mysystem("$gzip -cf $root.res | $uuencode $root.res.gz > $root.res.gz.uu");
+	  &mysystem("$gzip -cf \"$root.res\" | $uuencode \"$root.res.gz\" > \"$root.res.gz.uu\"");
 	}
 	else
@@ -529,5 +531,5 @@
     if ($keep ne "yes")
     {
-      &mysystem("$rm -f tst_status.out $resfile $root.res $root.diff $root.new.stat");
+      &mysystem("$rm -f tst_status.out $resfile \"$root.res\" \"$root.diff\" \"$root.new.stat\"");
     }
   }
@@ -546,4 +548,8 @@
   }
   $total_checks_pass++ unless $exit_status;
+
+  mysystem("mv gmon.out \"gmon.$root.out\"")
+    if (-e "gmon.out");
+
   return ($exit_status);
 }
