[Fix] nvm_is_version_or_alias: reject uppercase LTS names in every locale

bash 3.2, macOS's `/bin/sh`, matches a bracket range like `[a-z]` by collation order in a UTF-8 locale,
which interleaves upper- and lowercase letters,
so `lts/Iron` from a symlinked `.nvmrc` was accepted there.

Match with `[:lower:]` instead.
This commit is contained in:
Jordan Harband committed 2026-11-02 15:58:23 -06:00
1 parent 67268ebcb6
commit 93da6595ce
1 file changed
+1 -1
+1 -1
View File
@@ -953,7 +953,7 @@ nvm_is_version_or_alias() {
;;
lts/*)
case "${1#lts/}" in
'' | *[!a-z]*) return 1 ;;
'' | *[![:lower:]]*) return 1 ;;
esac
return 0
;;