Blame SOURCES/perl-XML-SAX-0.99-rt20126.patch

d12457
diff --git a/SAX/PurePerl.pm b/SAX/PurePerl.pm
d12457
--- a/SAX/PurePerl.pm	2006-04-24 01:20:09.000000000 +0200
d12457
+++ b/SAX/PurePerl.pm	2012-08-09 12:47:48.736728516 +0200
d12457
@@ -595,22 +595,23 @@ sub Comment {
d12457
     
d12457
     my $data = $reader->data(4);
d12457
     if ($data =~ /^
d12457
-        $reader->move_along(4);
d12457
+        $reader->move_along(4); # skip comment start
d12457
+        $data = $reader->data;
d12457
+        while ($data !~ m!-->!) {
d12457
+            my $n = $reader->read_more;
d12457
+             $self->parser_error("End of data seen while looking for close comment marker", $reader)
d12457
+                 unless $n;
d12457
+            $data = $reader->data;
d12457
+        }
d12457
+
d12457
         my $comment_str = '';
d12457
-        while (1) {
d12457
-            my $data = $reader->data;
d12457
-            $self->parser_error("End of data seen while looking for close comment marker", $reader)
d12457
-                unless length($data);
d12457
-            if ($data =~ /^(.*?)-->/s) {
d12457
-                $comment_str .= $1;
d12457
-                $self->parser_error("Invalid comment (dash)", $reader) if $comment_str =~ /-$/;
d12457
-                $reader->move_along(length($1) + 3);
d12457
-                last;
d12457
-            }
d12457
-            else {
d12457
-                $comment_str .= $data;
d12457
-                $reader->move_along(length($data));
d12457
-            }
d12457
+        if ($data =~ /^(.*?)-->/s) {
d12457
+            $comment_str = $1;
d12457
+            $self->parser_error("Invalid comment (dash)", $reader) if $comment_str =~ /-$/;
d12457
+            $reader->move_along(length($1) + 3);
d12457
+        }
d12457
+        else {
d12457
+            return 0;
d12457
         }
d12457
         
d12457
         $self->comment({ Data => $comment_str });