diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-09-03 01:20:36 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-09-03 01:20:36 -0400 |
| commit | e98e77e1d3fbc2a5fd4d26408d2b13ddbef07110 (patch) | |
| tree | 5fda9571d8a30d6a048305e7e811055eeb5b763e /builtins | |
| parent | 7b44044b5e96d5755c97470d121430e99cd7f990 (diff) | |
Fix for missing codepoint names
Diffstat (limited to 'builtins')
| -rw-r--r-- | builtins/text.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/builtins/text.c b/builtins/text.c index c4514892..66622f5f 100644 --- a/builtins/text.c +++ b/builtins/text.c @@ -1573,12 +1573,14 @@ public array_t Text$codepoint_names(Text_t text) for (int64_t c = 0; c < synthetic_graphemes[-grapheme-1].num_codepoints; c++) { char *name = GC_MALLOC_ATOMIC(UNINAME_MAX); name = unicode_character_name(synthetic_graphemes[-grapheme-1].codepoints[c], name); + if (!name) name = "???"; Text_t name_text = (Text_t){.tag=TEXT_ASCII, .length=strlen(name), .ascii=name}; Array$insert(&names, &name_text, I_small(0), sizeof(Text_t)); } } else { char *name = GC_MALLOC_ATOMIC(UNINAME_MAX); name = unicode_character_name(grapheme, name); + if (!name) name = "???"; Text_t name_text = (Text_t){.tag=TEXT_ASCII, .length=strlen(name), .ascii=name}; Array$insert(&names, &name_text, I_small(0), sizeof(Text_t)); } |
