aboutsummaryrefslogtreecommitdiffstats
path: root/CVSROOT
diff options
context:
space:
mode:
authorjoe <joe@FreeBSD.org>2001-05-17 19:04:36 +0800
committerjoe <joe@FreeBSD.org>2001-05-17 19:04:36 +0800
commit402315fefb40c40688a0d2e24f9427a2b95f6251 (patch)
tree5536fe28310c1c03b5d42eabd5e3181b4b849674 /CVSROOT
parent644e2092730fbf38f288f653050ce13198863ffd (diff)
downloadfreebsd-ports-gnome-402315fefb40c40688a0d2e24f9427a2b95f6251.tar.gz
freebsd-ports-gnome-402315fefb40c40688a0d2e24f9427a2b95f6251.tar.zst
freebsd-ports-gnome-402315fefb40c40688a0d2e24f9427a2b95f6251.zip
Fix the trimming of trailing blank lines, to avoid a 'Use of
uninitialized value'. Noticed by: imp
Diffstat (limited to 'CVSROOT')
-rwxr-xr-xCVSROOT/logcheck10
1 files changed, 7 insertions, 3 deletions
diff --git a/CVSROOT/logcheck b/CVSROOT/logcheck
index 422ff58abb32..2073e3c21d6a 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)