Patchwork Do not print warning messages when there are no occurences.

login
register
mail settings
Submitter Sebastian Pop
Date Sept. 17, 2010, 7:15 p.m.
Message ID <1284750943-31569-1-git-send-email-sebpop@gmail.com>
Download mbox | patch
Permalink /patch/65100/
State New
Headers show

Comments

Sebastian Pop - Sept. 17, 2010, 7:15 p.m.
The patch checker used to print warning messages "Lines should not
exceed 80 characters." even when there were no such lines in the
patch.  With this change, the warning message is printed only when
there are such occurrences.  Committed to trunk.

2010-07-02  Sebastian Pop  <sebastian.pop@amd.com>

	* check_GNU_style.sh: Do not print warning messages when there are
	no occurences.
---
 contrib/ChangeLog          |    5 +++++
 contrib/check_GNU_style.sh |    7 +++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

Patch

diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index 5175d51..a6b6e11 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,8 @@ 
+2010-07-02  Sebastian Pop  <sebastian.pop@amd.com>
+
+	* check_GNU_style.sh: Do not print warning messages when there are
+	no occurences.
+
 2010-07-08  Eric Botcazou  <ebotcazou@adacore.com>
 
 	* make_sunver.pl: Remove extra whitespace in regexp.
diff --git a/contrib/check_GNU_style.sh b/contrib/check_GNU_style.sh
index 6396417..8fb579f 100755
--- a/contrib/check_GNU_style.sh
+++ b/contrib/check_GNU_style.sh
@@ -84,8 +84,11 @@  col (){
 	| grep -v ':+++' \
 	| cut -f 2 -d '+' \
 	| awk '{ if (length ($0) > 80) print $0 }' \
-	> $tmp && printf "\n$msg\n"
-    cat $tmp
+	> $tmp
+    if [ -s $tmp ]; then
+	printf "\n$msg\n"
+	cat $tmp
+    fi
 }
 
 col 'Lines should not exceed 80 characters.' $*