From 83c48d9a1f15e1531ac7bec0c1440f69ace3ee37 Mon Sep 17 00:00:00 2001 From: Julian Fleischer Date: Thu, 2 Aug 2018 14:32:51 +0200 Subject: [PATCH] fix locale for lint-shell --- test/lint/lint-shell.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/lint/lint-shell.sh b/test/lint/lint-shell.sh index e2ccdb516..5e1e136e7 100755 --- a/test/lint/lint-shell.sh +++ b/test/lint/lint-shell.sh @@ -6,9 +6,15 @@ # # Check for shellcheck warnings in shell scripts. -# This script is intentionally locale dependent by not setting "export LC_ALL=C" -# to allow running certain versions of shellcheck that core dump when LC_ALL=C -# is set. +export LC_ALL=C + +# The shellcheck binary segfault/coredumps in Travis with LC_ALL=C +# It does not do so in Ubuntu 14.04, 16.04, 18.04 in versions 0.3.3, 0.3.7, 0.4.6 +# respectively. So export LC_ALL=C is set as required by lint-shell-locale.sh +# but unset here in case of running in Travis. +if [ "$TRAVIS" = "true" ]; then + unset LC_ALL +fi # Disabled warnings: # SC2001: See if you can use ${variable//search/replace} instead.