From 33cd95e61dcb5947e7671a8eb21d67014376495e Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Wed, 16 Jun 2021 22:54:43 +0200 Subject: Skip elipsizing if max characters are 0 - data/org.ayatana.common.gschema.xml.in: Set min value to 0 + update description - src/utils.c: Include hadling max allowed length of 0 - tests/CMakeLists.txt: Compile schema locally for testing - tests/tst_utils.cpp: Include handling max allowed length of 0 - po/ayatana-common.pot: Update translation strings - po/*.po: Update translation strings fixes https://github.com/AyatanaIndicators/libayatana-common/issues/29 --- src/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/utils.c b/src/utils.c index 1d21b02..0237461 100644 --- a/src/utils.c +++ b/src/utils.c @@ -293,7 +293,7 @@ void ayatana_common_utils_elipsize(char *sText) } } - if (nLetters > nMaxLetters + 4) + if (nMaxLetters > 0 && nLetters > nMaxLetters + 4) { gchar *pLastChar = g_utf8_offset_to_pointer(sText, nMaxLetters); memcpy(pLastChar, "...\0", 4); -- cgit v1.2.3