Changeset 19504 for util

Show
Ignore:
Timestamp:
01/16/08 05:40:11 (10 months ago)
Author:
agentz
Message:

[smartlinks.pl] fixed a bug when --test-res is set while test file info is not available (aka the newline prbolem) reported by Cosimo++

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • util/smartlinks.pl

    r19503 r19504  
    527527        s{L\<\"(http://.*?)\"\>} 
    528528         {L\&lt;<a href="$1">\&quot;$1\&quot;</a>\&gt;}g; 
    529         if (!$file_info) { 
    530             $src .= $_; 
    531             next; 
    532         } 
    533         chomp; 
    534         my $mark; 
    535         if (!exists $file_info->{$i}) { 
    536             $mark = ''; 
    537         } elsif ($file_info->{$i}) { 
    538             $mark = qq{<span class="ok"> √ </span>}; 
    539             $ok_count++; 
    540         } else { 
    541             $mark = qq{<span class="nok"> × </span>}; 
    542             $failed_count++; 
     529        my $mark = ''; 
     530        if ($file_info) { 
     531            chomp; 
     532            if (!exists $file_info->{$i}) { 
     533                $mark = ''; 
     534            } elsif ($file_info->{$i}) { 
     535                $mark = qq{<span class="ok"> √ </span>}; 
     536                $ok_count++; 
     537            } else { 
     538                $mark = qq{<span class="nok"> × </span>}; 
     539                $failed_count++; 
     540            } 
    543541        } 
    544542        $src .= qq{<tr><td><code>$mark</code></td><td><code>$_</code></td></tr>\n}; 
     
    557555    my $snippet; 
    558556    if (!$test_result) { 
    559         #warn "No test results for $file $from to $to"; 
     557        #warn "No test results for $file $from to $to"; 
    560558        $snippet = qq{<pre class="snip">$src</pre>}; 
    561559    } else { 
     
    960958    sub list_t_files($) { 
    961959        my ($dir) = @_; 
    962         #warn "DIR is ", $dir, "\n"; 
     960        #warn "DIR is ", $dir, "\n"; 
    963961        find(\&_list_t_files, $dir); 
    964962        return @my_t_files;