[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] maint.mk: detect_empty_lines_at_EOF_: avoid FP for an empty file
From: |
Jim Meyering |
Subject: |
[PATCH] maint.mk: detect_empty_lines_at_EOF_: avoid FP for an empty file |
Date: |
Sun, 11 Apr 2010 10:43:18 +0200 |
FYI,
I discovered (not in coreutils) that an empty version-controlled
file would provoke a false-positive match from this new rule.
But only when it is not the last file in the list.
$ :>empty; echo > f; echo g > g; tail -n1 empty f g
==> empty <==
==> f <==
==> g <==
g
This fixes it:
>From 2237d05df83cb4fc2adffaca11e0de3c2c5f28b1 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 11 Apr 2010 10:37:31 +0200
Subject: [PATCH] maint.mk: detect_empty_lines_at_EOF_: avoid FP for an empty
file
* top/maint.mk (detect_empty_lines_at_EOF_): Don't confuse an
empty file with one that ends in an empty line.
---
ChangeLog | 6 ++++++
top/maint.mk | 2 +-
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d79dcbf..1fdfa06 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-04-11 Jim Meyering <address@hidden>
+
+ maint.mk: detect_empty_lines_at_EOF_: avoid FP for an empty file
+ * top/maint.mk (detect_empty_lines_at_EOF_): Don't confuse an
+ empty file with one that ends in an empty line.
+
2010-04-10 Bruno Haible <address@hidden>
mkdir: Make it work on mingw64.
diff --git a/top/maint.mk b/top/maint.mk
index 6bfb4c1..b71304d 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -674,7 +674,7 @@ sc_prohibit_cvs_keyword:
# perl -pi -0777 -e 's/\n\n+$/\n/' files...
#
detect_empty_lines_at_EOF_ = \
- /^==> ([^\n]+) <==\n\n/m and (print "$$1\n"), $$fail = 1; \
+ /^==> ([^\n]+) <==\n\n\n/m and (print "$$1\n"), $$fail = 1; \
END { exit defined $$fail }
sc_prohibit_empty_lines_at_EOF:
@tail -n1 $$($(VC_LIST_EXCEPT)) /dev/null \
--
1.7.1.rc0.264.g94f6e
- [PATCH] maint.mk: detect_empty_lines_at_EOF_: avoid FP for an empty file,
Jim Meyering <=