[LON-CAPA-cvs] cvs: loncom /publisher loncfile.pm

taceyjo1 lon-capa-cvs@mail.lon-capa.org
Mon, 15 Dec 2003 22:01:14 -0000


taceyjo1		Mon Dec 15 17:01:14 2003 EDT

  Modified files:              
    /loncom/publisher	loncfile.pm 
  Log:
  Just some cleanup work, nothing really important, however, made easier by the great christmas cd
  
  
Index: loncom/publisher/loncfile.pm
diff -u loncom/publisher/loncfile.pm:1.47 loncom/publisher/loncfile.pm:1.48
--- loncom/publisher/loncfile.pm:1.47	Mon Dec 15 15:44:06 2003
+++ loncom/publisher/loncfile.pm	Mon Dec 15 17:01:14 2003
@@ -9,7 +9,7 @@
 #  and displays a page showing the results of the action.
 #
 #
-# $Id: loncfile.pm,v 1.47 2003/12/15 20:44:06 sakharuk Exp $
+# $Id: loncfile.pm,v 1.48 2003/12/15 22:01:14 taceyjo1 Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -858,31 +858,25 @@
     if(@files) { 
       $request->print('<font color="red"> '.&mt('Error: Directory Non Empty').'</font>'); 
       return 0;
-    }
-    else {   
+    } else {   
       if(-e $filename) {
         unless(rmdir($filename)) {
           $request->print('<font color="red">'.&mt('Error').': '.$!.'</font>');
           return 0;
         }
-      }
-      else {
-        $request->print('<p> '.&mt('No such file').'. </p></form');
+      } else {
+        $request->print('<p> '.&mt('No such file').'. </p></form>');
         return 0;
       }
-
      }
-
-   }
-  else {
+   } else {
     if(-e $filename) {
       unless(unlink($filename)) {
         $request->print('<font color="red">'.&mt('Error').': '.$!.'</font>');
         return 0;
       }
-    }
-    else {
-      $request->print('<p> '.&mt('No such file').'. </p></form');
+    } else {
+      $request->print('<p> '.&mt('No such file').'. </p></form>');
       return 0;
   }
 	}
@@ -1029,8 +1023,8 @@
 	$main=$2;		# Filename.
 	}
 	if($main=~m:\.(\w+)$:){ # Fixes problems with filenames with no extensions
-		$main=$`;
-		$suffix=$1;
+		$main=$`; #This is what is before the match (.) so it's just the main filename, yea it's nasty
+		$suffix=$1; #This is the actually filename extension if it exists
 	}
     my $dest;                   # On success this is where we'll go.