Skip to content

Commit

Permalink
sailcov: fix missing last line in output when using --colour-by-count…
Browse files Browse the repository at this point in the history
… option.

There was an off by one in the code for producing html when using the --colour-by-count that
resulting in producing no output for the last line of each sail source file. Line numbers are
numbered from 1 so no need to add one when comparing against array length.
  • Loading branch information
ronorton authored and Alasdair committed Jul 5, 2024
1 parent a59936b commit 19d83d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sailcov/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ let main () =
output_html_char chan source.(line - 1).(i).char
done;
output_string chan "<br>\n";
if line + 1 < Array.length source then finish (stack, line + 1, 0) else ()
if line < Array.length source then finish (stack, line + 1, 0) else ()
in
let stack, line, char = SpanMap.fold process combined ([], 1, 0) in
finish (stack, line, char)
Expand Down

0 comments on commit 19d83d6

Please sign in to comment.