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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 15 Jan 2007 18:34:33 -0000


albertel		Mon Jan 15 13:34:33 2007 EDT

  Modified files:              
    /loncom/publisher	londiff.pm 
  Log:
  - BUG#5146, handle files with different line endins in a single file
  
  
Index: loncom/publisher/londiff.pm
diff -u loncom/publisher/londiff.pm:1.22 loncom/publisher/londiff.pm:1.23
--- loncom/publisher/londiff.pm:1.22	Mon Dec  4 21:55:55 2006
+++ loncom/publisher/londiff.pm	Mon Jan 15 13:34:32 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to show differences between file versions
 #
-# $Id: londiff.pm,v 1.22 2006/12/05 02:55:55 albertel Exp $
+# $Id: londiff.pm,v 1.23 2007/01/15 18:34:32 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -55,16 +55,9 @@
 	    }
 	}
     } elsif ($style eq 'remote') {
-	my $f1=&Apache::lonnet::getfile($fn);
-    }
-    if ($f1=~/\r/) {
-	@f1=split(/\r/,&Apache::lonnet::getfile($fn));      
-	foreach my $line (@f1) {
-	    $line=~s/\n//g;
-	}
-    } else {
-	@f1=split(/\n/,&Apache::lonnet::getfile($fn));      
+	$f1=&Apache::lonnet::getfile($fn);
     }
+    @f1=split(/\r\n|\r|\n/,$f1);
     return @f1;
 }