From b5415fbc69dd33a1bb64a140b2f6bc73d11e4d22 Mon Sep 17 00:00:00 2001 From: Thomas Monjalon Date: Mon, 21 Nov 2016 23:42:41 +0100 Subject: [PATCH] scripts: fix checkpatch from standard input When checking a valid patch from standard input, the footer lines of the report are not filtered out. The function check is called outside of any loop, so the statement continue can have no effect and the footer is printed. More precisons about possible behaviours - with dash, the 'continue' acts like a return in that case - with bash, it displays an error: "continue: only meaningful in a `for', `while', or `until' loop" - with bash --posix, the 'continue' is ignored Fixes: 8005feef421d ("scripts: add standard input to checkpatch") Signed-off-by: Thomas Monjalon Acked-by: Olivier Matz --- scripts/checkpatches.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatches.sh b/scripts/checkpatches.sh index 336cc7b41d..cfe262bec4 100755 --- a/scripts/checkpatches.sh +++ b/scripts/checkpatches.sh @@ -94,7 +94,7 @@ check () { # else report=$($DPDK_CHECKPATCH_PATH $options - 2>/dev/null) fi - [ $? -ne 0 ] || continue + [ $? -ne 0 ] || return 0 $verbose || printf '\n### %s\n\n' "$3" printf '%s\n' "$report" | sed -n '1,/^total:.*lines checked$/p' status=$(($status + 1)) -- 2.20.1