diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2018-08-31 00:52:48 +0200 |
---|---|---|
committer | practicalswift <practicalswift@users.noreply.github.com> | 2018-08-31 00:52:48 +0200 |
commit | ec4d57bbb3ddbf760f2c31fec9add33aa19f1b1a (patch) | |
tree | 220a2120597581aaf0d477d4c30e7db28d27cd49 /test/lint/lint-locale-dependence.sh | |
parent | b57d7d92fe00ff44383e3d01ac15721dd75bde37 (diff) |
macOS fix: Work around empty (sub)expression error when using BSD grep
Diffstat (limited to 'test/lint/lint-locale-dependence.sh')
-rwxr-xr-x | test/lint/lint-locale-dependence.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/lint/lint-locale-dependence.sh b/test/lint/lint-locale-dependence.sh index a5b97ca1e9..cbee437c91 100755 --- a/test/lint/lint-locale-dependence.sh +++ b/test/lint/lint-locale-dependence.sh @@ -197,11 +197,11 @@ REGEXP_IGNORE_KNOWN_VIOLATIONS=$(join_array "|" "${KNOWN_VIOLATIONS[@]}") # Invoke "git grep" only once in order to minimize run-time REGEXP_LOCALE_DEPENDENT_FUNCTIONS=$(join_array "|" "${LOCALE_DEPENDENT_FUNCTIONS[@]}") -GIT_GREP_OUTPUT=$(git grep -E "[^a-zA-Z0-9_\`'\"<>](${REGEXP_LOCALE_DEPENDENT_FUNCTIONS}(|_r|_s))[^a-zA-Z0-9_\`'\"<>]" -- "*.cpp" "*.h") +GIT_GREP_OUTPUT=$(git grep -E "[^a-zA-Z0-9_\`'\"<>](${REGEXP_LOCALE_DEPENDENT_FUNCTIONS}(_r|_s)?)[^a-zA-Z0-9_\`'\"<>]" -- "*.cpp" "*.h") EXIT_CODE=0 for LOCALE_DEPENDENT_FUNCTION in "${LOCALE_DEPENDENT_FUNCTIONS[@]}"; do - MATCHES=$(grep -E "[^a-zA-Z0-9_\`'\"<>]${LOCALE_DEPENDENT_FUNCTION}(|_r|_s)[^a-zA-Z0-9_\`'\"<>]" <<< "${GIT_GREP_OUTPUT}" | \ + MATCHES=$(grep -E "[^a-zA-Z0-9_\`'\"<>]${LOCALE_DEPENDENT_FUNCTION}(_r|_s)?[^a-zA-Z0-9_\`'\"<>]" <<< "${GIT_GREP_OUTPUT}" | \ grep -vE "\.(c|cpp|h):\s*(//|\*|/\*|\").*${LOCALE_DEPENDENT_FUNCTION}" | \ grep -vE 'fprintf\(.*(stdout|stderr)') if [[ ${REGEXP_IGNORE_EXTERNAL_DEPENDENCIES} != "" ]]; then |