diff options
author | Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de> | 2020-02-25 18:09:44 +0000 |
---|---|---|
committer | Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de> | 2020-02-25 18:09:44 +0000 |
commit | 245c9315466593447691d4dbff87b5fecdc6f117 (patch) | |
tree | 8281ea853a435617b9098b4223c2ac4f40235850 /subr | |
parent | 77addcec5ebd0279072497fdf692acae22e0cb3d (diff) | |
download | midipix_build-245c9315466593447691d4dbff87b5fecdc6f117.tar.bz2 midipix_build-245c9315466593447691d4dbff87b5fecdc6f117.tar.xz |
subr/ex_rtl_string.subr: explicitly expand [a-z] and [A-Z] to mitigate locale-dependent case issues.
Diffstat (limited to 'subr')
-rw-r--r-- | subr/ex_rtl_string.subr | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/subr/ex_rtl_string.subr b/subr/ex_rtl_string.subr index 703ae1b2..9b8874fa 100644 --- a/subr/ex_rtl_string.subr +++ b/subr/ex_rtl_string.subr @@ -32,10 +32,10 @@ ex_rtl_tolower() { X*) _s_new="${_s_new:+${_s_new}}x"; _s="${_s#X}"; ;; Y*) _s_new="${_s_new:+${_s_new}}y"; _s="${_s#Y}"; ;; Z*) _s_new="${_s_new:+${_s_new}}z"; _s="${_s#Z}"; ;; - [^A-Z]*) - _s_new="${_s_new:+${_s_new}}${_s%%[A-Z]*}"; - while [ "${_s#[^A-Z]}" != "${_s}" ]; do - _s="${_s#[^A-Z]}"; + [^ABCDEFGHIJKLMNOPQRSTUVWXYZ]*) + _s_new="${_s_new:+${_s_new}}${_s%%[ABCDEFGHIJKLMNOPQRSTUVWXYZ]*}"; + while [ "${_s#[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]}" != "${_s}" ]; do + _s="${_s#[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]}"; done; ;; esac; done; echo "${_s_new}"; @@ -71,10 +71,10 @@ ex_rtl_toupper() { x*) _s_new="${_s_new:+${_s_new}}X"; _s="${_s#x}"; ;; y*) _s_new="${_s_new:+${_s_new}}Y"; _s="${_s#y}"; ;; z*) _s_new="${_s_new:+${_s_new}}Z"; _s="${_s#z}"; ;; - [^a-z]*) - _s_new="${_s_new:+${_s_new}}${_s%%[a-z]*}"; - while [ "${_s#[^a-z]}" != "${_s}" ]; do - _s="${_s#[^a-z]}"; + [^abcdefghijklmnopqrstuvwxyz]*) + _s_new="${_s_new:+${_s_new}}${_s%%[abcdefghijklmnopqrstuvwxyz]*}"; + while [ "${_s#[^abcdefghijklmnopqrstuvwxyz]}" != "${_s}" ]; do + _s="${_s#[^abcdefghijklmnopqrstuvwxyz]}"; done; ;; esac; done; echo "${_s_new}"; |