From 0deb4908a24c03c03cc9a7a0353f47a947648852 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Sun, 17 Aug 2014 18:44:04 -0400 Subject: [PATCH] Bug 4162 - Followup: only count potential barcodes 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 Empty lines are now no longer counted as potential barcodes. Passes tests and QA script. Signed-off-by: Tomas Cohen Arazi --- tools/inventory.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/inventory.pl b/tools/inventory.pl index 02559490f7..6a5ddc4874 100755 --- a/tools/inventory.pl +++ b/tools/inventory.pl @@ -170,9 +170,9 @@ if ( $uploadbarcodes && length($uploadbarcodes) > 0 ) { 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; } -- 2.39.5