From b8faea851ccb9545ea68d989d6a619c754fb8580 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sun, 22 Aug 2021 13:08:53 -0300 Subject: tests/c-lint.sh: Use grep exit status instead of empty string output --- tests/c-lint.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/c-lint.sh') diff --git a/tests/c-lint.sh b/tests/c-lint.sh index 7c5516d..42d185c 100755 --- a/tests/c-lint.sh +++ b/tests/c-lint.sh @@ -1,8 +1,9 @@ #!/bin/sh -if [ -n "$(grep -En '[a-z]+\(\) {' "$@")" ]; then +RE='[a-z]+\(\) {' +if grep -Eq "$RE" "$@"; then echo 'Functions with no argument without explicit "void" parameter:' >&2 - grep -En '[a-z]+\(\) {' "$@" + grep -En "$RE" "$@" exit 1 fi -- cgit v1.2.3