[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 09 Sep 2004 08:26:46 -0000


albertel		Thu Sep  9 04:26:46 2004 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - BUG#3427, filenames like syl.08.04.doc would cause sillyness.
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.539 loncom/lonnet/perl/lonnet.pm:1.540
--- loncom/lonnet/perl/lonnet.pm:1.539	Thu Sep  2 17:23:13 2004
+++ loncom/lonnet/perl/lonnet.pm	Thu Sep  9 04:26:46 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.539 2004/09/02 21:23:13 albertel Exp $
+# $Id: lonnet.pm,v 1.540 2004/09/09 08:26:46 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1284,6 +1284,9 @@
     $fname=~s/\s+/\_/g;
 # Replace all other weird characters by nothing
     $fname=~s/[^\w\.\-]//g;
+# Replace all .\d. sequences with _\d. so they no longer look like version
+# numbers
+    $fname=~s/\.(\d+)(?=\.)/_$1/g;
     return $fname;
 }