aboutsummaryrefslogtreecommitdiff
path: root/builtins/text.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-09-06 04:10:41 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-09-06 04:10:41 -0400
commit89a1f8a401b3ccd1c9708c718c4560e78d2cdd8a (patch)
treece2cad40abc0e8b80bc2749870da785009d43ba6 /builtins/text.c
parente47c45a93b775e3adfcd9e48a1bd474cd94f6e2e (diff)
Misc fixes
Diffstat (limited to 'builtins/text.c')
-rw-r--r--builtins/text.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/builtins/text.c b/builtins/text.c
index f99a8728..4d385cda 100644
--- a/builtins/text.c
+++ b/builtins/text.c
@@ -943,6 +943,7 @@ public bool Text$equal_ignoring_case(Text_t a, Text_t b)
public Text_t Text$upper(Text_t text)
{
+ if (text.length == 0) return text;
Array_t codepoints = Text$utf32_codepoints(text);
const char *language = uc_locale_language();
uint32_t buf[128];
@@ -955,6 +956,7 @@ public Text_t Text$upper(Text_t text)
public Text_t Text$lower(Text_t text)
{
+ if (text.length == 0) return text;
Array_t codepoints = Text$utf32_codepoints(text);
const char *language = uc_locale_language();
uint32_t buf[128];
@@ -967,6 +969,7 @@ public Text_t Text$lower(Text_t text)
public Text_t Text$title(Text_t text)
{
+ if (text.length == 0) return text;
Array_t codepoints = Text$utf32_codepoints(text);
const char *language = uc_locale_language();
uint32_t buf[128];