markup-validator commit: Fix transcode error parsing for docs without linefeeds.

changeset:   3241:249fe5f9b57f
tag:         tip
user:        Ville Skyttä <ville.skytta@iki.fi>
date:        Wed Jun 08 22:59:32 2011 +0300
files:       httpd/cgi-bin/check
description:
Fix transcode error parsing for docs without linefeeds.

http://www.w3.org/mid/907C7FACCE66B940A1473B51352419934BDCB570F7%40LNET-SRV-EXMBX1.landsnet.far.local


diff -r a58d162fc6d3 -r 249fe5f9b57f httpd/cgi-bin/check
--- a/httpd/cgi-bin/check	Wed Jun 08 09:14:05 2011 +0300
+++ b/httpd/cgi-bin/check	Wed Jun 08 22:59:32 2011 +0300
@@ -3200,7 +3200,7 @@
         # Transcoding failed - do it again line by line to find out exactly
         # where
         my $line_num = 0;
-        while ($input =~ /(.*?)(?:\r\n|\n|\r)/g) {
+        while ($input =~ /(.*?)(?:\r\n|\n|\r|\z)/g) {
             $line_num++;
             eval { $enc->decode($1, Encode::FB_CROAK); };
             if ($@) {

Received on Wednesday, 8 June 2011 19:59:43 UTC