--- loncom/publisher/londiff.pm 2006/04/06 22:15:18 1.18 +++ loncom/publisher/londiff.pm 2006/05/17 13:41:45 1.19 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to show differences between file versions # -# $Id: londiff.pm,v 1.18 2006/04/06 22:15:18 albertel Exp $ +# $Id: londiff.pm,v 1.19 2006/05/17 13:41:45 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -32,6 +32,7 @@ package Apache::londiff; use strict; use Apache::File; use File::Copy; +use File::Compare; use Algorithm::Diff qw(diff); use Apache::Constants qw(:common :http :methods); use Apache::loncacc; @@ -44,7 +45,7 @@ sub get_split_file { my ($fn,$style)=@_; my $f1; my @f1; - if ($style='local') { + if ($style eq 'local') { if (-e $fn) { my $fh=Apache::File->new($fn); my $line; @@ -66,6 +67,11 @@ sub get_split_file { return @f1; } +sub are_different_files { + my ($fileone,$filetwo)=@_; + return &compare($fileone,$filetwo); +} + sub handler { my $r=shift; @@ -124,7 +130,7 @@ sub handler { $r->print(''.&mt('Construction Space Version').''); } else { my $fn= - '/home/httpd/html//res/'.$cudom.'/'.$cuname.'/'; + '/home/httpd/html/res/'.$cudom.'/'.$cuname.'/'; if ($env{'form.versionone'}) { my ($main,$suffix)=($efn=~/^(.+)\.(\w+)$/); $fn.=$main.'.'.$env{'form.versionone'}.'.'.$suffix;