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

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