[otrs-cvs] ImportExport/Kernel/System/ImportExport/FormatBackend CSV.pm, 1.29, 1.30

"CVS commits notifications of OTRS.org" <[email protected]> Wed, 26 Jun 2013 14:22:08 +0000
Newsgroups gmane.comp.otrs.cvs
Message-ID <[email protected]>
Comments:
Update of /home/cvs/ImportExport/Kernel/System/ImportExport/FormatBackend
In directory lancelot:/tmp/cvs-serv5862/Kernel/System/ImportExport/FormatBackend

Modified Files:
	CSV.pm 
Log Message:
Fixed bug# 9270 - ImportError ErrorCode 2012  EOF - End of data in parsing input stream. 

Author: ub

Index: CSV.pm
===================================================================
RCS file: /home/cvs/ImportExport/Kernel/System/ImportExport/FormatBackend/CSV.pm,v
retrieving revision 1.29
retrieving revision 1.30
diff -2 -u -d -r1.29 -r1.30
--- CSV.pm	5 May 2011 09:20:45 -0000	1.29
+++ CSV.pm	26 Jun 2013 14:22:03 -0000	1.30
@@ -1,5 +1,5 @@
 # --
 # Kernel/System/ImportExport/FormatBackend/CSV.pm - import/export backend for CSV
-# Copyright (C) 2001-2011 OTRS AG, http://otrs.org/
+# Copyright (C) 2001-2013 OTRS AG, http://otrs.org/
 # --
 # $Id$
@@ -316,5 +316,11 @@
     my $LineCount = 1;
     my @ImportData;
-    while ( my $Column = $ParseObject->getline($FH) ) {
+
+    # it is important to use this syntax "while ( !eof($FH) )"
+    # as the CPAN module Text::CSV_XS might show errors if the
+    # getline call is within the while test
+    # have a look at http://bugs.otrs.org/show_bug.cgi?id=9270
+    while ( !eof($FH) ) {
+        my $Column = $ParseObject->getline($FH);
         push @ImportData, $Column;
         $LineCount++;
---------------------------------------------------------------------
OTRS mailing list: cvs-log - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/cvs-log
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/cvs-log