From 245c9315466593447691d4dbff87b5fecdc6f117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 25 Feb 2020 18:09:44 +0000 Subject: subr/ex_rtl_string.subr: explicitly expand [a-z] and [A-Z] to mitigate locale-dependent case issues. --- subr/ex_rtl_string.subr | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'subr/ex_rtl_string.subr') 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}"; -- cgit v1.2.3