Make nonint do_change_locale work with encoding field as well (#167)

This commit is contained in:
garyk10 2022-01-04 10:10:56 -05:00 committed by GitHub
parent 20a4cee6e5
commit 26e568102f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -492,7 +492,7 @@ do_change_locale() {
dpkg-reconfigure locales
else
local LOCALE="$1"
if ! LOCALE_LINE="$(grep "^$LOCALE " /usr/share/i18n/SUPPORTED)"; then
if ! LOCALE_LINE="$(grep -E "^$LOCALE( |$)" /usr/share/i18n/SUPPORTED)"; then
return 1
fi
local ENCODING="$(echo $LOCALE_LINE | cut -f2 -d " ")"