summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko2013-08-20 16:13:05 +0200
committerDenys Vlasenko2013-08-20 16:13:05 +0200
commit1b9ac2116643e34a9dbfb67624aa2276480b4b6e (patch)
tree9643719809bf650f6440c0f42fe3bd896b45f569
parent0ff0b320a2dbb5e0b5fa245ffd9b2648d7026843 (diff)
downloadbusybox-1b9ac2116643e34a9dbfb67624aa2276480b4b6e.zip
busybox-1b9ac2116643e34a9dbfb67624aa2276480b4b6e.tar.gz
lineedit: use unicode_strwidth instead of unicode_strlen
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--libbb/lineedit.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index b3f16cd..b168f1b 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -1774,7 +1774,7 @@ static void parse_and_put_prompt(const char *prmt_ptr)
const char *p;
cmdedit_prompt = prmt_ptr;
p = strrchr(prmt_ptr, '\n');
- cmdedit_prmt_len = unicode_strlen(p ? p+1 : prmt_ptr);
+ cmdedit_prmt_len = unicode_strwidth(p ? p+1 : prmt_ptr);
put_prompt();
}
#else
@@ -1943,7 +1943,7 @@ static void parse_and_put_prompt(const char *prmt_ptr)
#if 0 /*ENABLE_UNICODE_SUPPORT*/
/* Won't work, pbuf is one BYTE string here instead of an one Unicode char string. */
/* FIXME */
- cmdedit_prmt_len += unicode_strlen(pbuf);
+ cmdedit_prmt_len += unicode_strwidth(pbuf);
#else
cmdedit_prmt_len += n;
#endif
@@ -2202,7 +2202,7 @@ static int32_t reverse_i_search(void)
free((char*)cmdedit_prompt);
set_prompt:
cmdedit_prompt = xasprintf("(reverse-i-search)'%s': ", match_buf);
- cmdedit_prmt_len = unicode_strlen(cmdedit_prompt);
+ cmdedit_prmt_len = unicode_strwidth(cmdedit_prompt);
goto do_redraw;
}
}