[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[4740] addons/1.3/import_trans/trunk/scripts/ import_trans.pl



Revision: 4740
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4740&view=rev
Author:   einhverfr
Date:     2012-05-21 01:27:52 +0000 (Mon, 21 May 2012)
Log Message:
-----------
Corrected csv infinite loop

Modified Paths:
--------------
    addons/1.3/import_trans/trunk/scripts/import_trans.pl

Modified: addons/1.3/import_trans/trunk/scripts/import_trans.pl
===================================================================
--- addons/1.3/import_trans/trunk/scripts/import_trans.pl	2012-05-21 01:04:48 UTC (rev 4739)
+++ addons/1.3/import_trans/trunk/scripts/import_trans.pl	2012-05-21 01:27:52 UTC (rev 4740)
@@ -138,7 +138,8 @@
         $line =~ s/[^"]"",/"/g;
         while ($line ne '') {
             if ($line =~ /^"/){
-                $line =~ s/"(.*?)"(,|$)//;
+                $line =~ s/"(.*?)"(,|$)//
+                   || $self->error($self->{_locale}->text('Invalid file'));
                 my $field = $1;
                 $field =~ s/\s*$//;
                 push @fields, $field;

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.