From 7a18043a968ec6d4b8c4c8cac059ad977d14e47c Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 19 Aug 2013 16:44:05 +0200 Subject: lineedit: improve Unicode handling (still buggy though) function old new delta unicode_strlen - 31 +31 read_line_input 3876 3879 +3 lineedit_read_key 255 246 -9 parse_and_put_prompt 785 755 -30 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/2 up/down: 34/-39) Total: -5 bytes Signed-off-by: Denys Vlasenko --- libbb/unicode.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'libbb/unicode.c') diff --git a/libbb/unicode.c b/libbb/unicode.c index 2e5dd5adc..9c4da50d3 100644 --- a/libbb/unicode.c +++ b/libbb/unicode.c @@ -43,8 +43,7 @@ void FAST_FUNC reinit_unicode(const char *LANG) setlocale(LC_CTYPE, LANG ? LANG : ""); /* In unicode, this is a one character string */ -// can use unicode_strlen(string) too, but otherwise unicode_strlen() is unused - width = mbstowcs(NULL, unicode_0x394, INT_MAX); + width = unicode_strlen(unicode_0x394); unicode_status = (width == 1 ? UNICODE_ON : UNICODE_OFF); } @@ -986,7 +985,6 @@ int FAST_FUNC unicode_bidi_is_neutral_wchar(wint_t wc) /* The rest is mostly same for libc and for "homegrown" support */ -#if 0 // UNUSED size_t FAST_FUNC unicode_strlen(const char *string) { size_t width = mbstowcs(NULL, string, INT_MAX); @@ -994,7 +992,6 @@ size_t FAST_FUNC unicode_strlen(const char *string) return strlen(string); return width; } -#endif size_t FAST_FUNC unicode_strwidth(const char *string) { -- cgit v1.2.3