Handle "locale -a" returning both C.UTF-8 and C.utf8.

It is possible to have mutiple matches from the output of "locale
-a".  Just take the first one.  Fixes GitHub issue #241.
This commit is contained in:
Todd C. Miller
2023-02-15 13:49:04 -07:00
parent 4f50692acc
commit 2845ceafb0
7 changed files with 19 additions and 19 deletions

View File

@@ -229,7 +229,7 @@ check-fuzzer:
check: $(TEST_PROGS) check-fuzzer
@if test X"$(cross_compiling)" != X"yes"; then \
l=`locale -a 2>&1 | $(EGREP) -i '^C.UTF-?8$$'` || true; \
l=`locale -a 2>&1 | $(EGREP) -i '^C\.UTF-?8$$' | $(SED) 1q` || true; \
test -n "$$l" || l="C"; \
LC_ALL="$$l"; export LC_ALL; \
unset LANG || LANG=; \