summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorduerst <duerst@localhost>2001-07-21 11:32:06 +0000
committerduerst <duerst@localhost>2001-07-21 11:32:06 +0000
commit9192d5eb19287bb78c122c0d55ac37feade65463 (patch)
treeb21e4a51c1dfcdb6dfc0fa49d3ea5679fd4a7954
parent666c476649651ea99389b728971570eb20acb2b8 (diff)
downloadmarkup-validator-9192d5eb19287bb78c122c0d55ac37feade65463.zip
markup-validator-9192d5eb19287bb78c122c0d55ac37feade65463.tar.gz
markup-validator-9192d5eb19287bb78c122c0d55ac37feade65463.tar.bz2
replaced m/^G.../g in while loop with s/...// for utf-8 checking.
is easier to understand, and faster.
-rwxr-xr-xhttpd/cgi-bin/check17
1 files changed, 8 insertions, 9 deletions
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check
index 5982b9a..151c786 100755
--- a/httpd/cgi-bin/check
+++ b/httpd/cgi-bin/check
@@ -9,7 +9,7 @@
# This source code is available under the license at:
# http://www.w3.org/Consortium/Legal/copyright-software
#
-# $Id: check,v 1.154 2001-07-20 06:23:03 link Exp $
+# $Id: check,v 1.155 2001-07-21 11:32:06 duerst Exp $
#
# We need Perl 5.004.
@@ -80,9 +80,9 @@ my $element_ref = 'http://www.htmlhelp.com/reference/html40/';
#
# Strings
-$VERSION = q$Revision: 1.154 $;
+$VERSION = q$Revision: 1.155 $;
$VERSION =~ s/Revision: ([\d\.]+) /$1/;
-$DATE = q$Date: 2001-07-20 06:23:03 $;
+$DATE = q$Date: 2001-07-21 11:32:06 $;
$MAINTAINER = 'gerald@w3.org';
$NOTICE = ''; # "<p><strong>Note: This service will be ...</strong>";
@@ -437,10 +437,10 @@ EOHD
my $p;
for (@{$File->{Content}}) {
$line++;
- # while loop needed for very long lines (>32K),
+ # substitution needed for very long lines (>32K),
# to avoid backtrack stack overflow
- $p = 0; # make sure this works for empty lines
- while (m/\G( # \G: start where we left in previous loop
+ my $l = $_;
+ $l =~ s/
[\x00-\x7F] # ASCII
| [\xC2-\xDF] [\x80-\xBF] # non-overlong 2-byte sequences
| \xE0[\xA0-\xBF] [\x80-\xBF] # excluding overlongs
@@ -449,9 +449,8 @@ EOHD
| \xF0[\x90-\xBF] [\x80-\xBF]{2} # planes 1-3
| [\xF1-\xF3] [\x80-\xBF]{3} # planes 4-15
| \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16
- )
- /xg) { $p = pos; } # assignement needed because pos lost outside loop
- push @lines, $line unless ($p == length);
+ //xg;
+ push @lines, $line if (length $l);
}
}
if(@lines) {