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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 10 Feb 2003 23:13:17 -0000


albertel		Mon Feb 10 18:13:17 2003 EDT

  Modified files:              
    /loncom/publisher	loncfile.pm 
  Log:
  - part of BUG#1246, renames dont need fileextension
  
  
Index: loncom/publisher/loncfile.pm
diff -u loncom/publisher/loncfile.pm:1.23 loncom/publisher/loncfile.pm:1.24
--- loncom/publisher/loncfile.pm:1.23	Tue Feb  4 17:01:38 2003
+++ loncom/publisher/loncfile.pm	Mon Feb 10 18:13:17 2003
@@ -7,10 +7,9 @@
 #  presents a page that describes the proposed action to the user
 #  and requests confirmation.  The second phase commits the action
 #  and displays a page showing the results of the action.
-# 
-
 #
-# $Id: loncfile.pm,v 1.23 2003/02/04 22:01:38 albertel Exp $
+#
+# $Id: loncfile.pm,v 1.24 2003/02/10 23:13:17 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -495,6 +494,12 @@
     if(-e $conspace) {
 	if($ENV{'form.newfilename'}) {
 	    my $newfilename = $ENV{'form.newfilename'};
+	    if ($newfilename =~ m|^[^\.]+$|) {
+		#no extension add on orignal extension
+		if ($filename =~ m|/[^\.]*\.([^\.]+)$|) {
+		    $newfilename.='.'.$1;
+		}
+	    }
 	    $request->print(&checksuffix($filename, $newfilename));
 	    my $return=&exists($user, $domain, $dir, $newfilename);
 	    $request->print($return);