[Koha-patches] [PATCH] Bug 6723 : import-framework-crlf

Chris Cormack chrisc at catalyst.net.nz
Mon Aug 15 23:42:57 CEST 2011


From: Ward van Wanrooij <wvanwanrooij at nextfactory.nl>

Signed-off-by: Chris Cormack <chrisc at catalyst.net.nz>
---
 C4/ImportExportFramework.pm |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/C4/ImportExportFramework.pm b/C4/ImportExportFramework.pm
index 7f29e51..cc17462 100755
--- a/C4/ImportExportFramework.pm
+++ b/C4/ImportExportFramework.pm
@@ -761,7 +761,7 @@ sub _parseSQLLine
     my $line;
     my $numLines = 0;
     while (<$dom>) {
-        chomp $_;
+        s/[\r\n]+$//;
         $line = $_;
         # we don't want to execute any sql statement, only the ones dealing with frameworks
         next unless ($line =~ /^\s*(?i:DELETE\s+FROM|INSERT\s+INTO)\s+(?:marc_tag_structure|marc_subfield_structure)/);
@@ -1148,7 +1148,7 @@ sub _import_table_csv
         if ($row =~ /(?:".*?",?)+/) {
             @arrData = split('","', $row);
             $arrData[0] = substr($arrData[0], 1) if ($arrData[0] =~ /^"/);
-            chomp $arrData[$#arrData];
+            $arrData[$#arrData] =~ s/[\r\n]+$//;
             chop $arrData[$#arrData] if ($arrData[$#arrData] =~ /"$/);
             if (@arrData) {
                 if ($arrData[0] eq '#-#' && $arrData[$#arrData] eq '#-#') {
-- 
1.7.4.1



More information about the Koha-patches mailing list