aboutsummaryrefslogtreecommitdiff
path: root/sh/profile.d
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-01-09 00:50:17 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-01-09 00:50:17 +1300
commit4dca4a2620fed992a0c71834f6ac6d7a72192741 (patch)
tree7be30e918e8f15e1727020044d27ec0c2f419567 /sh/profile.d
parentForce LC_COLLATE to a sane value (diff)
downloaddotfiles-4dca4a2620fed992a0c71834f6ac6d7a72192741.tar.gz
dotfiles-4dca4a2620fed992a0c71834f6ac6d7a72192741.zip
Much simpler LC_COLLATE approach
Diffstat (limited to 'sh/profile.d')
-rw-r--r--sh/profile.d/lang.sh19
1 files changed, 4 insertions, 15 deletions
diff --git a/sh/profile.d/lang.sh b/sh/profile.d/lang.sh
index 44d1cefa..21f67d5b 100644
--- a/sh/profile.d/lang.sh
+++ b/sh/profile.d/lang.sh
@@ -1,15 +1,4 @@
-# Use the system's locale and language, but if it's not C or C.UTF-8, then
-# force LC_COLLATE to an appropriate C locale so that the order of sort and
-# glob expansion stays sane without making e.g. dates insane. Don't interfere
-# at all if LANG isn't even set.
-case $LANG in
- C|C.UTF-8) ;;
- *)
- if locale -a | grep -q C.UTF-8 ; then
- LC_COLLATE=C.UTF-8
- else
- LC_COLLATE=C
- fi
- export LC_COLLATE
- ;;
-esac
+# Always use bytewise sorting if not already set
+[ -z "$LC_COLLATE" ] || return
+LC_COLLATE=C
+export LC_COLLATE