[Bioperl-guts-l] [16914] bioperl-live/trunk/Bio/SeqIO/embl.pm: [bug 3025] patch fixing infinite loop (courtesy Adam Sj?\195?\184gren)

Christopher John Fields cjfields at dev.open-bio.org
Wed Mar 10 19:23:24 EST 2010


Revision: 16914
Author:   cjfields
Date:     2010-03-10 19:23:23 -0500 (Wed, 10 Mar 2010)
Log Message:
-----------
[bug 3025] patch fixing infinite loop (courtesy Adam Sj?\195?\184gren)

Modified Paths:
--------------
    bioperl-live/trunk/Bio/SeqIO/embl.pm

Modified: bioperl-live/trunk/Bio/SeqIO/embl.pm
===================================================================
--- bioperl-live/trunk/Bio/SeqIO/embl.pm	2010-03-09 20:22:12 UTC (rev 16913)
+++ bioperl-live/trunk/Bio/SeqIO/embl.pm	2010-03-11 00:23:23 UTC (rev 16914)
@@ -1432,7 +1432,7 @@
 
   CHUNK: while($line) {
         foreach my $pat ($regex, '[,;\.\/-]\s|'.$regex, '[,;\.\/-]|'.$regex) {
-            if ($line =~ m/^(.{1,$subl})($pat)(.*)/ ) {
+            if ($line =~ m/^(.{0,$subl})($pat)(.*)/ ) {
                 my $l = $1.$2;
                 $l =~ s/#/ /g  # remove word wrap protection char '#'
                     if $pre1 eq "RA   ";
@@ -1441,6 +1441,7 @@
                 # be strict about not padding spaces according to
                 # genbank format
                 $l =~ s/\s+$//;
+                next CHUNK if ($l eq '');
                 push(@lines, $l);
                 next CHUNK;
             }



More information about the Bioperl-guts-l mailing list