aboutsummaryrefslogtreecommitdiff
path: root/tests/c-lint.sh
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-08-22 13:08:53 -0300
committerEuAndreh <eu@euandre.org>2021-08-22 13:08:53 -0300
commitb8faea851ccb9545ea68d989d6a619c754fb8580 (patch)
tree5f81014bad612a42000b72796b0c052086842fe8 /tests/c-lint.sh
parenttests/dev-integration.sh: Fix calls to executable and test (diff)
downloadgistatic-b8faea851ccb9545ea68d989d6a619c754fb8580.tar.gz
gistatic-b8faea851ccb9545ea68d989d6a619c754fb8580.tar.xz
tests/c-lint.sh: Use grep exit status instead of empty string output
Diffstat (limited to 'tests/c-lint.sh')
-rwxr-xr-xtests/c-lint.sh5
1 files changed, 3 insertions, 2 deletions
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