[LON-CAPA-cvs] cvs: loncom /homework lonhomework.pm /lonnet/perl lonnet.pm /xml lonxml.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Thu, 30 Oct 2003 20:22:00 -0000
albertel Thu Oct 30 15:22:00 2003 EDT
Modified files:
/loncom/xml lonxml.pm
/loncom/lonnet/perl lonnet.pm
/loncom/homework lonhomework.pm
Log:
- convert end lines into unix style \n
- modify lonxml html editor and problem editor to correct this
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.289 loncom/xml/lonxml.pm:1.290
--- loncom/xml/lonxml.pm:1.289 Wed Oct 29 13:29:24 2003
+++ loncom/xml/lonxml.pm Thu Oct 30 15:22:00 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# XML Parser Module
#
-# $Id: lonxml.pm,v 1.289 2003/10/29 18:29:24 sakharuk Exp $
+# $Id: lonxml.pm,v 1.290 2003/10/30 20:22:00 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1060,6 +1060,7 @@
sub storefile {
my ($file,$contents)=@_;
+ &Apache::lonnet::correct_line_ends(\$contents);
if (my $fh=Apache::File->new('>'.$file)) {
print $fh $contents;
$fh->close();
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.435 loncom/lonnet/perl/lonnet.pm:1.436
--- loncom/lonnet/perl/lonnet.pm:1.435 Wed Oct 29 19:26:25 2003
+++ loncom/lonnet/perl/lonnet.pm Thu Oct 30 15:22:00 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network
# TCP networking package
#
-# $Id: lonnet.pm,v 1.435 2003/10/30 00:26:25 www Exp $
+# $Id: lonnet.pm,v 1.436 2003/10/30 20:22:00 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -4395,6 +4395,13 @@
return 2;
}
return 1;
+}
+
+sub correct_line_ends {
+ my ($result)=@_;
+ &logthis("Wha $result");
+ $$result =~s/\r\n/\n/mg;
+ $$result =~s/\r/\n/mg;
}
# ================================================================ Main Program
Index: loncom/homework/lonhomework.pm
diff -u loncom/homework/lonhomework.pm:1.155 loncom/homework/lonhomework.pm:1.156
--- loncom/homework/lonhomework.pm:1.155 Wed Oct 15 13:41:10 2003
+++ loncom/homework/lonhomework.pm Thu Oct 30 15:22:00 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Homework handler
#
-# $Id: lonhomework.pm,v 1.155 2003/10/15 17:41:10 albertel Exp $
+# $Id: lonhomework.pm,v 1.156 2003/10/30 20:22:00 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -378,6 +378,8 @@
my $filebak =$file.".bak";
my $filetmp =$file.".tmp";
my $error=0;
+
+ &Apache::lonnet::correct_line_ends($result);
if ($ENV{'form.Undo'} eq &mt('undo')) {
my $error=0;