validator/httpd/cgi-bin check,1.305.2.139,1.305.2.140

Update of /sources/public/validator/httpd/cgi-bin
In directory hutz:/tmp/cvs-serv16543

Modified Files:
      Tag: validator-0_6_0-branch
	check 
Log Message:
Avoid warnings from transcode() when iconv returns undef.

Index: check
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/check,v
retrieving revision 1.305.2.139
retrieving revision 1.305.2.140
diff -u -d -r1.305.2.139 -r1.305.2.140
--- check	28 May 2004 22:13:04 -0000	1.305.2.139
+++ check	29 May 2004 07:36:23 -0000	1.305.2.140
@@ -2697,14 +2697,15 @@
     my $in = $_;
     $line++;
     $_ = $c->convert($_); # $_ is local!!
-    if ($in ne "" and $_ eq "") {
+    if ($in ne "" and (!defined($_) || $_ eq "")) {
       push @{$File->{Lines}}, $line;
       # try to decoded as much as possible of the line
       my $short = 0;               # longest okay
       my $long = (length $in) - 1; # longest unknown
       while ($long > $short) { # binary search
         my $try = int (($long+$short+1) / 2);
-        if ($c->convert(substr($in,0,$try)) eq "") {
+        my $converted = $c->convert(substr($in, 0, $try));
+        if (!defined($converted) || $converted eq "") {
           $long  = $try-1;
         } else {
           $short = $try;

Received on Saturday, 29 May 2004 03:36:26 UTC