[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] maint.mk: use gnu-style indentation in an embedded perl script
From: |
Jim Meyering |
Subject: |
[PATCH] maint.mk: use gnu-style indentation in an embedded perl script |
Date: |
Sat, 17 Apr 2010 22:16:37 +0200 |
FYI,
no semantic change
>From 340812dc815bfb7579805a866715de3cb386b040 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sat, 17 Apr 2010 22:13:41 +0200
Subject: [PATCH] maint.mk: use gnu-style indentation in an embedded perl script
* top/maint.mk (detect_empty_lines_at_EOF_): Clean up formatting.
Rename variable: s/two/last_two_bytes/
---
ChangeLog | 6 ++++++
top/maint.mk | 22 ++++++++++++----------
2 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 4d56e5a..0b90da0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-04-17 Jim Meyering <address@hidden>
+
+ maint.mk: use gnu-style indentation in an embedded perl script
+ * top/maint.mk (detect_empty_lines_at_EOF_): Clean up formatting.
+ Rename variable: s/two/last_two_bytes/
+
2010-04-16 Eric Blake <address@hidden>
test-stdbool: skip test that fails with Solaris CC
diff --git a/top/maint.mk b/top/maint.mk
index cb8461c..f646e43 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -694,16 +694,18 @@ sc_prohibit_cvs_keyword:
# perl -pi -0777 -e 's/\n\n+$/\n/' files...
#
detect_empty_lines_at_EOF_ = \
- foreach my $$f (@ARGV) { \
- open F, "<", $$f or (warn "failed to open $$f: $$!\n"), next; \
- my $$p = sysseek (F, -2, 2); \
- my $$c = "seek failure probably means file has < 2 bytes; ignore"; \
- my $$two; \
- defined $$p and $$p = sysread F, $$two, 2; \
- close F; \
- $$c = "ignore read failure"; \
- $$p && $$two eq "\n\n" and (print $$f), $$fail=1; \
- } END { exit defined $$fail }
+ foreach my $$f (@ARGV) \
+ { \
+ open F, "<", $$f or (warn "failed to open $$f: $$!\n"), next; \
+ my $$p = sysseek (F, -2, 2); \
+ my $$c = "seek failure probably means file has < 2 bytes; ignore"; \
+ my $$last_two_bytes; \
+ defined $$p and $$p = sysread F, $$last_two_bytes, 2; \
+ close F; \
+ $$c = "ignore read failure"; \
+ $$p && $$last_two_bytes eq "\n\n" and (print $$f), $$fail=1; \
+ } \
+ END { exit defined $$fail }
sc_prohibit_empty_lines_at_EOF:
@perl -le '$(detect_empty_lines_at_EOF_)' $$($(VC_LIST_EXCEPT)) \
|| { echo '$(ME): the above files end with empty line(s)' \
--
1.7.1.rc1.269.ga27c7
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] maint.mk: use gnu-style indentation in an embedded perl script,
Jim Meyering <=