diff options
| -rw-r--r-- | builtins/table.h | 2 | ||||
| -rw-r--r-- | builtins/text.c | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/builtins/table.h b/builtins/table.h index 12f20f29..91e87bc5 100644 --- a/builtins/table.h +++ b/builtins/table.h @@ -35,7 +35,7 @@ void *Table$get(Table_t t, const void *key, const TypeInfo *type); const Table_t t = table_expr; key_t k = key_expr; const TypeInfo* info = info_expr; \ val_t *v = Table$get(t, &k, info); \ if (__builtin_expect(v == NULL, 0)) \ - fail_source(__SOURCE_FILE__, start, end, "The key %r is not in this table\n", generic_as_text(&k, no, info->TableInfo.key)); \ + fail_source(__SOURCE_FILE__, start, end, "The key %k is not in this table\n", (Text_t[1]){generic_as_text(&k, no, info->TableInfo.key)}); \ *v; }) #define Table$get_value_or_default(table_expr, key_t, val_t, key_expr, default_val, info_expr) ({ \ const Table_t t = table_expr; const key_t k = key_expr; \ 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]; |
