summaryrefslogtreecommitdiffstats
path: root/CVSROOT/logcheck
diff options
context:
space:
mode:
authorjoe <joe@FreeBSD.org>2001-05-17 11:04:36 +0000
committerjoe <joe@FreeBSD.org>2001-05-17 11:04:36 +0000
commit402315fefb40c40688a0d2e24f9427a2b95f6251 (patch)
tree5536fe28310c1c03b5d42eabd5e3181b4b849674 /CVSROOT/logcheck
parent644e2092730fbf38f288f653050ce13198863ffd (diff)
downloadFreeBSD-ports-402315fefb40c40688a0d2e24f9427a2b95f6251.zip
FreeBSD-ports-402315fefb40c40688a0d2e24f9427a2b95f6251.tar.gz
Fix the trimming of trailing blank lines, to avoid a 'Use of
uninitialized value'. Noticed by: imp
Diffstat (limited to 'CVSROOT/logcheck')
-rwxr-xr-xCVSROOT/logcheck10
1 files changed, 7 insertions, 3 deletions
diff --git a/CVSROOT/logcheck b/CVSROOT/logcheck
index 422ff58..2073e3c 100755
--- a/CVSROOT/logcheck
+++ b/CVSROOT/logcheck
@@ -54,16 +54,20 @@ open IN, "< $filename" or
my @log_in = map { s/^(.*?)\s*$/$1/; $1 } grep { !/^CVS:/ } <IN>;
close IN;
-# Remove leading, trailing and duplicate blank lines.
+# Remove duplicate blank lines.
my $i = 0;
-while ($i < scalar(@log_in)) {
+while ($i < scalar(@log_in) - 1) {
if ($log_in[$i] eq "" && $log_in[$i + 1] eq "") {
splice(@log_in, $i, 1);
next;
}
++$i;
}
-shift @log_in unless $log_in[0];
+
+# Remove leading and trailing blank lines. (There will be at most
+# one because of the duplicate removal above).
+shift @log_in if $log_in[0] eq "";
+pop @log_in if $log_in[-1] eq "";
# Filter out blank templated entries, and type check if necessary.
# (looking from the end of the commit message backwards)
OpenPOWER on IntegriCloud