X-Git-Url: https://ruderich.org/simon/gitweb/?p=blhc%2Fblhc.git;a=blobdiff_plain;f=bin%2Fblhc;h=2ae115015036a3a2feecc836578c59057d89f196;hp=5d408c31e0c6a70aaa5360c9c9ae667785abd001;hb=0c6b6b89c3bc35a85aa1bef12ef4e6323085e4b3;hpb=efdac689c531b78c27e7ec2c9e03af621c104e40 diff --git a/bin/blhc b/bin/blhc index 5d408c3..2ae1150 100755 --- a/bin/blhc +++ b/bin/blhc @@ -471,12 +471,13 @@ while (my $line = <>) { # line. parse_line() is slow, only use it when necessary. my @line = (not $line =~ /;/) ? ($line) - : Text::ParseWords::parse_line(';', 1, $line); + : map { + # Ensure newline at the line end - necessary for correct + # parsing later. + $_ =~ s/\s+$//; + $_ .= "\n"; + } Text::ParseWords::parse_line(';', 1, $line); foreach $line (@line) { - # Add newline, drop all other whitespace at the end of a line. - $line =~ s/\s+$//; - $line .= "\n"; - if ($continuation) { $continuation = 0;