diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2013-08-20 16:13:05 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2013-08-20 16:13:05 +0200 |
commit | 1b9ac2116643e34a9dbfb67624aa2276480b4b6e (patch) | |
tree | 9643719809bf650f6440c0f42fe3bd896b45f569 | |
parent | 0ff0b320a2dbb5e0b5fa245ffd9b2648d7026843 (diff) | |
download | busybox-w32-1b9ac2116643e34a9dbfb67624aa2276480b4b6e.tar.gz busybox-w32-1b9ac2116643e34a9dbfb67624aa2276480b4b6e.tar.bz2 busybox-w32-1b9ac2116643e34a9dbfb67624aa2276480b4b6e.zip |
lineedit: use unicode_strwidth instead of unicode_strlen
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | libbb/lineedit.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c index b3f16cd9d..b168f1b86 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c | |||
@@ -1774,7 +1774,7 @@ static void parse_and_put_prompt(const char *prmt_ptr) | |||
1774 | const char *p; | 1774 | const char *p; |
1775 | cmdedit_prompt = prmt_ptr; | 1775 | cmdedit_prompt = prmt_ptr; |
1776 | p = strrchr(prmt_ptr, '\n'); | 1776 | p = strrchr(prmt_ptr, '\n'); |
1777 | cmdedit_prmt_len = unicode_strlen(p ? p+1 : prmt_ptr); | 1777 | cmdedit_prmt_len = unicode_strwidth(p ? p+1 : prmt_ptr); |
1778 | put_prompt(); | 1778 | put_prompt(); |
1779 | } | 1779 | } |
1780 | #else | 1780 | #else |
@@ -1943,7 +1943,7 @@ static void parse_and_put_prompt(const char *prmt_ptr) | |||
1943 | #if 0 /*ENABLE_UNICODE_SUPPORT*/ | 1943 | #if 0 /*ENABLE_UNICODE_SUPPORT*/ |
1944 | /* Won't work, pbuf is one BYTE string here instead of an one Unicode char string. */ | 1944 | /* Won't work, pbuf is one BYTE string here instead of an one Unicode char string. */ |
1945 | /* FIXME */ | 1945 | /* FIXME */ |
1946 | cmdedit_prmt_len += unicode_strlen(pbuf); | 1946 | cmdedit_prmt_len += unicode_strwidth(pbuf); |
1947 | #else | 1947 | #else |
1948 | cmdedit_prmt_len += n; | 1948 | cmdedit_prmt_len += n; |
1949 | #endif | 1949 | #endif |
@@ -2202,7 +2202,7 @@ static int32_t reverse_i_search(void) | |||
2202 | free((char*)cmdedit_prompt); | 2202 | free((char*)cmdedit_prompt); |
2203 | set_prompt: | 2203 | set_prompt: |
2204 | cmdedit_prompt = xasprintf("(reverse-i-search)'%s': ", match_buf); | 2204 | cmdedit_prompt = xasprintf("(reverse-i-search)'%s': ", match_buf); |
2205 | cmdedit_prmt_len = unicode_strlen(cmdedit_prompt); | 2205 | cmdedit_prmt_len = unicode_strwidth(cmdedit_prompt); |
2206 | goto do_redraw; | 2206 | goto do_redraw; |
2207 | } | 2207 | } |
2208 | } | 2208 | } |