http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10625
--- Comment #12 from Marc Véron <[email protected]> --- Created attachment 37848 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37848&action=edit [Signed-off] Bug 10625: Inventory/Stocktaking tool cannot handle windows file uploads The current code uses $barcode = <fh>; logic. This reads until \n, as far as I can tell. EOL is indicated by \n, \r, and \r\n depending on OS and software. So, to this end, rather than File::Slurp (which is a potential memory hog, which is already an issue with no filters), a loop to pre-read the barcodes was written. This loop includes: $barcode =~ s/\r/\n/g; $barcode =~ s/\n\n/\n/g; $barcode =~ s/\n$//; $barcode =~ s/^\n//; my @data = split(/\n/, $barcode); push @uploadedbarcodes,@data; So, that means that lines ending in \n would have it stripped and pushed into the uploaded barcodes array. Lines ending in \r would likely be read as one giant block, have everything converted to single \n's and then using a split, the set of barcodes are pushed into the uploaded barcodes array. Lines ending in \r\n would get that stripped and pushed into the uploaded barcodes array. It is then the uploaded barcodes array that is looped over for validating the barcodes. TEST PLAN --------- 1) Create a file with at least three different barcodes. --- I tested with the test file provided and with a file where some lines have CR and other lines have CR NL (inserted with Win text editor). Worked as expected. Signed-off-by: Marc Véron <[email protected]> -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
