mirror of
https://github.com/classy-giraffe/easy-arch.git
synced 2025-11-17 19:40:55 +00:00
fix locale existence check
shouldn't be using the -x option since locales always appear with the charset on the same line, making matches impossible. Also removed -F since some regex is needed to ensure only locales are matched, and added a sed to escape regex characters in $locale before its sent to grep so the user can't type something like "e." and match the "eo" locale accidentally.
This commit is contained in:
parent
31acfd3b0c
commit
fd49d164de
1 changed files with 1 additions and 1 deletions
|
|
@ -203,7 +203,7 @@ locale_selector () {
|
|||
'/') sed -E '/^# +|^#$/d;s/^#| *$//g;s/ .*/ (Charset:&)/' /etc/locale.gen | less -M
|
||||
clear
|
||||
return 1;;
|
||||
*) if ! grep -Fxq $locale /etc/locale.gen; then
|
||||
*) if ! grep -q "^#\?$(sed 's/[].*[]/\\&/g' <<< $locale) " /etc/locale.gen; then
|
||||
incEcho "The specified locale doesn't exist or isn't supported."
|
||||
return 1
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue