The $lines_read++; was before the code which skipped empty
lines. By moving it after the next unless $barcode; code, the
$lines_read variable only counts potential barcodes, and does
not include empty lines.
TEST PLAN
---------
1) Apply patch.
2) Attempt a valid barcode file with empty lines.
-- The potential barcode count should exclude the empty lines.
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Empty lines are now no longer counted as potential barcodes.
Passes tests and QA script.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
my $lines_read=0;
binmode($uploadbarcodes, ":encoding(UTF-8)");
while (my $barcode=<$uploadbarcodes>){
- ++$lines_read;
$barcode =~ s/\r?\n$//;
next unless $barcode;
+ ++$lines_read;
if (length($barcode)>$barcode_size) {
$err_length += 1;
}