Louis-Philippe Véronneau pushed to branch master at lintian / lintian
Commits:
-
b4ca5070
by Timo Paulssen at 2024-11-02T19:14:40+00:00
1 changed file:
Changes:
| ... | ... | @@ -100,18 +100,23 @@ sub visit_patched_files { |
| 100 | 100 | my $longest;
|
| 101 | 101 | my $length = $ITEM_NOT_FOUND;
|
| 102 | 102 | my $position = 0;
|
| 103 | + my $is_sql = $item->basename =~ /sql/i;
|
|
| 103 | 104 | while (my $line = <$fd>) {
|
| 104 | 105 | $position++;
|
| 105 | 106 | |
| 106 | - # Skip SQL insert and select statements
|
|
| 107 | - next if ($line =~ /^(INSERT|SELECT)\s/i
|
|
| 108 | - and $item->basename =~ /sql/i);
|
|
| 107 | + # If the line can't be longer than our current longest,
|
|
| 108 | + # no need to decode.
|
|
| 109 | + next if( length $line < $length );
|
|
| 109 | 110 | |
| 110 | 111 | # count codepoints, if possible
|
| 111 | 112 | $line = decode_utf8($line)
|
| 112 | 113 | if valid_utf8($line);
|
| 113 | 114 | |
| 114 | 115 | if( length $line > $length ) {
|
| 116 | + # Skip SQL insert and select statements
|
|
| 117 | + next if ($is_sql
|
|
| 118 | + and $line =~ /^(INSERT|SELECT)\s/i);
|
|
| 119 | + |
|
| 115 | 120 | $longest = $position;
|
| 116 | 121 | $length = length $line;
|
| 117 | 122 | }
|