From fb001ee7a72ae054fff742f66c7917e337a42d71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 9 Jun 2020 17:31:58 +0200 Subject: [PATCH] unicode combining: don't log overflow errors unless LOG_ENABLE_DBG == 1 --- CHANGELOG.md | 2 ++ vt.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef18f4d4..7ac1f035 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,8 @@ lines in the scrolling region.. * New terminal windows spawned with `ctrl`+`shift`+`n` are no longer double forked. +* Unicode combining character overflow errors are only logged in when + debug logging has been enabled. ### Deprecated diff --git a/vt.c b/vt.c index 454ba11d..4aa101f9 100644 --- a/vt.c +++ b/vt.c @@ -604,12 +604,13 @@ action_utf8_print(struct terminal *term, wchar_t wc) if (wanted_count > ALEN(composed->combining)) { assert(composed != NULL); +#if defined(LOG_ENABLE_DBG) && LOG_ENABLE_DBG LOG_WARN("combining character overflow:"); LOG_WARN(" base: 0x%04x", composed->base); for (size_t i = 0; i < composed->count; i++) LOG_WARN(" cc: 0x%04x", composed->combining[i]); LOG_ERR(" new: 0x%04x", wc); - +#endif /* This are going to break anyway... */ wanted_count--; }