X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=lib-ui%2Fcurs_lib.c;h=45d7b03986737d6263c08a4f219b997cd75e5a44;hb=25594eeaad2af2d06328b47283cfba72fa3bc8cd;hp=510eccf24e605893ba127fb9afb74d54574a4755;hpb=688ac22f746f785c27ac99ac86aa85a3035a3638;p=apps%2Fmadmutt.git diff --git a/lib-ui/curs_lib.c b/lib-ui/curs_lib.c index 510eccf..45d7b03 100644 --- a/lib-ui/curs_lib.c +++ b/lib-ui/curs_lib.c @@ -706,32 +706,3 @@ void mutt_paddstr (int n, const char *s) addch (' '); } -/* - * mutt_strwidth is like m_strlenexcept that it returns the width - * refering to the number of characters cells. - */ - -int mutt_strwidth (const char *s) -{ - wchar_t wc; - int w; - ssize_t k, n; - mbstate_t mbstate; - - if (!s) - return 0; - - n = m_strlen(s); - - p_clear(&mbstate, 1); - for (w = 0; n && (k = mbrtowc (&wc, s, n, &mbstate)); s += k, n -= k) { - if (k == -1 || k == -2) { - k = (k == -1) ? 1 : n; - wc = CharsetReplacement; - } - if (!iswprint(wc)) - wc = '?'; - w += wcwidth (wc); - } - return w; -}