From 07838bfcb16bf329bbc4953dff5b624005a8a734 Mon Sep 17 00:00:00 2001 From: Ward van Wanrooij Date: Mon, 15 Aug 2011 14:38:40 +0200 Subject: [PATCH] Bug 6723 : import-framework-crlf Signed-off-by: Chris Cormack Signed-off-by: Ian Walls --- C4/ImportExportFramework.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/ImportExportFramework.pm b/C4/ImportExportFramework.pm index e518771824..a2b650b8eb 100755 --- a/C4/ImportExportFramework.pm +++ b/C4/ImportExportFramework.pm @@ -762,7 +762,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)/); @@ -1161,7 +1161,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 '#-#') { -- 2.39.5