File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ #
3
+ # Copyright (c) 2018 The Bitcoin Core developers
4
+ # Distributed under the MIT software license, see the accompanying
5
+ # file COPYING or http://www.opensource.org/licenses/mit-license.php.
6
+ #
7
+ # Make sure all shell scripts:
8
+ # a.) explicitly opt out of locale dependence using "export LC_ALL=C", or
9
+ # b.) explicitly opt in to locale dependence using the annotation below.
10
+
11
+ export LC_ALL=C
12
+
13
+ EXIT_CODE=0
14
+ for SHELL_SCRIPT in $( git ls-files -- " *.sh" | grep -vE " src/(secp256k1|univalue)/" ) ; do
15
+ if grep -q " # This script is intentionally locale dependent by not setting \" export LC_ALL=C\" " " ${SHELL_SCRIPT} " ; then
16
+ continue
17
+ fi
18
+ FIRST_NON_COMMENT_LINE=$( grep -vE ' ^(#.*|)$' " ${SHELL_SCRIPT} " | head -1)
19
+ if [[ ${FIRST_NON_COMMENT_LINE} != " export LC_ALL=C" ]]; then
20
+ echo " Missing \" export LC_ALL=C\" (to avoid locale dependence) as first non-comment non-empty line in ${SHELL_SCRIPT} "
21
+ EXIT_CODE=1
22
+ fi
23
+ done
24
+ exit ${EXIT_CODE}
You can’t perform that action at this time.
0 commit comments