]> arthur.barton.de Git - ax-zsh.git/commitdiff
12_locale: Enhance matching of Linux systems
authorAlexander Barton <alex@barton.de>
Sat, 6 Jun 2020 18:47:22 +0000 (20:47 +0200)
committerAlexander Barton <alex@barton.de>
Sat, 6 Jun 2020 18:47:22 +0000 (20:47 +0200)
The OSTYPE is "linux-gnu" on AMD64, but it is "linux-gnueabihf" on the
RaspberryPi, for example. So use a regular expression and match for
"^linux-gnu" ...

core/12_locale/12_locale.zprofile

index 5e7d8803815b92f47531ebbb56482f282bdff0fd..689b67421db3ee4ac0ea91f6e392905e6be7b20a 100644 (file)
@@ -32,7 +32,7 @@ while true; do
        [[ "$lc_messages" = '"C"' && "$LANG" != 'C' && "$LC_ALL" != 'C' ]] && lc_messages=$LANG
        lc_messages=$lc_messages:gs/\"//
        locale=$lc_messages:r
-       [[ ( "$OSTYPE" = 'linux-gnu' || "$OSTYPE" = 'cygwin') && $locale != 'C' ]] \
+       [[ ( "$OSTYPE" =~ '^linux-gnu' || "$OSTYPE" = 'cygwin') && $locale != 'C' ]] \
                && encoding=$lc_messages:e:l:gs/-// \
                || encoding=$lc_messages:e
        [[ -n "$encoding" ]] && locale="$locale.$encoding"